Results 1 to 6 of 6
Hybrid View
-
21st Sep 2012, 03:13 AM #1OPMemberWebsite's:
innovative-coding.com wolfs-rain.org wolfsrain.org infothread.orgmouse over img script
anyone got a script for when you mouse over a link (<A>) or an img it will show a larger version of it in a popup, but not full size. I dont want the img being larger than teh screen and going off screen.. kinda like how 4chanX expands the img when you hover over it and it follows the cursor..if the image is too large its resized and it never goes off screen
I currently have a script, but it does what I dont want. If the image is on the right side and you hover over it, it will expand to the right and you cant see the image. You also can only view the fullsize image. So if the image is 2000x2500 -- youll miss half the image because its off screen.
jQuery prefered
Ive tried damn near everything.
any help is appreciated
---------- Post added at 11:13 PM ---------- Previous post was at 10:25 PM ----------
If noone has a script for that. Can you help me modify my existing code so it doesnt load the image offscreen
__Doc_ Reviewed by __Doc_ on . mouse over img script anyone got a script for when you mouse over a link (<A>) or an img it will show a larger version of it in a popup, but not full size. I dont want the img being larger than teh screen and going off screen.. kinda like how 4chanX expands the img when you hover over it and it follows the cursor..if the image is too large its resized and it never goes off screen I currently have a script, but it does what I dont want. If the image is on the right side and you hover over it, it will expand to the Rating: 5
-
21st Sep 2012, 01:48 PM #2Respected Member
Lightbox is one. Highslide is another.
-
21st Sep 2012, 05:09 PM #3OPMemberWebsite's:
innovative-coding.com wolfs-rain.org wolfsrain.org infothread.org
-
21st Sep 2012, 09:32 PM #4Respected Member
I guess you just want to pop a window with the largest width and length without going outside browser size.
Code:<html> <head> <script language='JavaScript'> function getImgSize(imgSrc) { var hp = 0.00; var wp = 0.00; var pct = 0.00; var newImg = new Image(); newImg.src = imgSrc; if (newImg.height > self.innerHeight) {hp=self.innerHeight/newImg.height;} if (newImg.width > self.innerWidth) {wp=self.innerWidth/newImg.width;} if (hp<wp) {pct = hp; } else { pct = wp; } if (pct == 0) { pct =100;} my_window = window.open("", "mywindow1", "status=1,width="+hp*newImg.width+",height="+hp*newImg.height); my_window.document.write('<img height='+hp*newImg.height+' width='+hp*newImg.width+' src="'+newImg.src+'" >'); } </script> </head> <body> <IMG id='demoImg' width=15% src="yourImage.jpg" onMouseOver="getImgSize(document.getElementById('demoImg').src);"><br> <div width=100%> </div> </body></html>
-
24th Sep 2012, 06:57 PM #5OPMemberWebsite's:
innovative-coding.com wolfs-rain.org wolfsrain.org infothread.org
-
25th Sep 2012, 09:36 AM #6MemberWebsite's:
wscripts.net damnlolscript.com lulzjet.comwhy you don't post the link here ....
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
What Is your Mouse Clicking Speed
By nasavsisro in forum Useful SitesReplies: 52Last Post: 31st Dec 2011, 06:09 AM -
What mouse do you use?
By DuckBre in forum General DiscussionReplies: 26Last Post: 12th Sep 2011, 12:39 PM -
Track pad vs Mouse
By thecompgame in forum Polling PlazaReplies: 12Last Post: 29th Jul 2011, 06:33 PM -
Mouse Vs Keyboard
By Jazzyb in forum Polling PlazaReplies: 17Last Post: 27th Nov 2010, 02:28 AM -
Which mouse to buy?
By uzonigor in forum General DiscussionReplies: 18Last Post: 18th Jul 2010, 05:53 AM
themaPoster - post to forums and...
Version 5.35 released. Open older version (or...