PDA

View Full Version : Cut & Paste Pop-up image viewer II


badmojo123
01-05-2003, 11:56 PM
Cut & Paste Pop-up image viewer II

I want to enable a scrollbar so when the link is clicked the new window uses a scrollbar. Here is the java lines of code taken from this site.

<script>

/*
Pop up image viewer script II
By JavaScript Kit (http://javascriptkit.com)
Over 400+ free scripts here!
*/

function popimage(imagesrc,winwidth,winheight){
var look='width='+winwidth+',height='+winheight+','
popwin=window.open("","",look)
popwin.document.open()
popwin.document.write('<title>Image Window</title><body><img src="'+imagesrc+'"></body>')
popwin.document.close()
}

</script>

and this is the way to use it.

<a href="test.htm" onClick="popimage('test.gif',120,31);return false">Test</a>


So where can I use some sort of scrollbar enable or on or whatever. I need the scrollbars to be vertical not horizontal. Thanks in advance and as a newbie here I hope this post is complete and fullfills the rules that are set out. Thanks in advance.

BadMojo

chrismiceli
01-06-2003, 12:56 AM
ty this

<script>

/*
Pop up image viewer script II
By JavaScript Kit (http://javascriptkit.com)
Over 400+ free scripts here!
*/

function popimage(imagesrc,winwidth,winheight){
var look='width='+winwidth+',height='+winheight+','
popwin=window.open("","",look)
popwin.document.open()
popwin.document.write('<title>Image Window</title><style>body {x-overflow:hidden}</style><body><img src="'+imagesrc+'"></body>')
popwin.document.close()
}

</script>

and this is the way to use it.

<a href="test.htm" onClick="popimage('test.gif',120,31);return false">Test</a>

badmojo123
01-06-2003, 01:26 AM
Didn't work anything else?

chrismiceli
01-06-2003, 04:00 AM
sorry, it should be
overflow-x: hidden
but that only works w/ ie6 and up.

badmojo123
01-06-2003, 12:20 PM
Nope that didn't work. Can you think of another script that does the same thing maybe?

badmojo123
01-06-2003, 03:01 PM
If anyone cares or not I actually got that code to work here is the lines you need and thanks for the help Chris.

<script>

/*
Pop up image viewer script II
By JavaScript Kit (http://javascriptkit.com)
Over 400+ free scripts here!
*/

function popimage(imagesrc,winwidth,winheight,winsb){
var look='width='+winwidth+',height='+winheight+',scrollbars='+winsb+' ,'
popwin=window.open("","",look)
popwin.document.open()
popwin.document.write('<title>Image Window</title><body><img src="'+imagesrc+'"></body>')
popwin.document.close()
}

</script>

and this is the way to use it.

<a href="test.htm" onClick="popimage('test.gif',120,31,1);return false">Test</a>

I am not taking any credit for this code I just simply found out how to add a scrollbar. Hope this helps someone else one day:D