Webmaster Forum

Lionsanime Directory   High Bandwidth Dedicated Servers   V7N Directory
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Reply
 
LinkBack Thread Tools Display Modes
Old 11-21-2007, 12:11 PM   #1 (permalink)
Contributing Member
 
oracle's Avatar
 
Join Date: 04-23-07
Posts: 242
iTrader: 0 / 0%
oracle is liked by somebodyoracle is liked by somebodyoracle is liked by somebody
Thumbnail Coding

Hello, I need help with creating an image gallery....I want the thumbnails to open in a pop-up window....how will i do it? I've only come up with the image opening in a new window when clicked...
__________________
Web Design Company

"We all know a fool when we see one -- but not when we are one." ~ Arnold H. Glasow
oracle is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 11-21-2007, 12:50 PM   #2 (permalink)
Contributing Member
 
Diddy1's Avatar
 
Join Date: 06-22-06
Location: Da Hood
Posts: 306
iTrader: 0 / 0%
Diddy1 is liked by somebodyDiddy1 is liked by somebodyDiddy1 is liked by somebodyDiddy1 is liked by somebodyDiddy1 is liked by somebody
I don't know if you want a script or actual specific coding but here's a list of scripts you can use: hotscripts.

Thank You
Diddy1 is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-22-2007, 06:06 AM   #3 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,909
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
pop-up window:
Quote:
<script>
var win = window.open("url_to image", "windowTitle", "some_features");
win.focus();
</script>
"windowTitle" -> set a title to the window (do not insert spaces)(this argument is optional)
"some_features" -> window features, like width, height and so on (this argument is optional)

hope this helps.
__________________
JUNE - JavaScript Framework
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-22-2007, 12:12 PM   #4 (permalink)
Contributing Member
 
oracle's Avatar
 
Join Date: 04-23-07
Posts: 242
iTrader: 0 / 0%
oracle is liked by somebodyoracle is liked by somebodyoracle is liked by somebody
Thanks Costin....

Now, my question is how do I insert that to this...
Quote:
<ul class="gallery">
<li><a href="IMAGE URL" onclick="window.open(this.href);return false;" onclick="window.open(this.href)" title="view larger version"><img src="IMAGE URL" alt="" width="100" height="150" /></a>
</li>
sorry to be a pest but I'm really new at this...
__________________
Web Design Company

"We all know a fool when we see one -- but not when we are one." ~ Arnold H. Glasow

Last edited by oracle : 11-22-2007 at 12:22 PM.
oracle is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-23-2007, 06:18 AM   #5 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,909
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
Code:
<html xmlns="http://www.w3.org/1999/xhtml" > <head> <title></title> <style type="text/css"> img { border: none 0; cursor: pointer; } </style> <script type="text/javascript"> function createImagePreview(imageID, windowName, windowFeatures) { var imageSrc = document.getElementById(imageID).getAttribute('src'); windowName = windowName || 'title'; var thisImage = document.getElementById(imageID), _width = thisImage.style.width, _height = thisImage.style.height; var features = "width="+_width+", height="+_height; windowFeatures = features || null; var popup = window.open(imageSrc, windowName, windowFeatures); popup.focus(); } function preventNavigation() { var markedLinks = document.getElementsByTagName("a"); for ( var i in markedLinks) { if (markedLinks[i].className == "nav") { markedLinks[i].removeAttribute("href"); } } } window.onload = preventNavigation; </script> </head> <body> <a class="nav" href="test1.gif" onclick="javascript:createImagePreview('T1');"><img id="T1" alt="" src="test1.gif" style="width: 70px; height: 70px;" /></a><br /><br /> <a class="nav" href="test2.gif" onclick="javascript:createImagePreview('T2');"><img id="T2" alt="" src="test2.gif" style="width: 50px; height: 60px;" /></a><br /><br /> <a class="nav" href="test3.gif" onclick="javascript:createImagePreview('T3');"><img id="T3" alt="" src="test3.gif" style="width: 45px; height: 52px;" /></a><br /><br /> </body> </html>

Now you have two functions:
- createImagePreview
- preventNavigation

The first one will create the popup window and the second one is used to prevent navigation away from the currently viewed page if someone will click one of your images (that is for those users that have javascript enabled).

However, the second function will be called only when the user will click the links that have the class "nav".

hope this helps
__________________
JUNE - JavaScript Framework
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-23-2007, 08:18 AM   #6 (permalink)
Contributing Member
 
oracle's Avatar
 
Join Date: 04-23-07
Posts: 242
iTrader: 0 / 0%
oracle is liked by somebodyoracle is liked by somebodyoracle is liked by somebody
Thanks a lot Costin! You've been a great help....
oracle is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-23-2007, 11:50 AM   #7 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,909
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
Glad I could help!
__________________
JUNE - JavaScript Framework
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-28-2007, 03:30 AM   #8 (permalink)
v7n Mentor
 
Join Date: 01-16-07
Location: Assen, the Netherlands
Posts: 1,379
iTrader: 1 / 100%
Latest Blog:
None

Jesse Vlasveld is a splendid one to beholdJesse Vlasveld is a splendid one to beholdJesse Vlasveld is a splendid one to beholdJesse Vlasveld is a splendid one to beholdJesse Vlasveld is a splendid one to beholdJesse Vlasveld is a splendid one to beholdJesse Vlasveld is a splendid one to beholdJesse Vlasveld is a splendid one to beholdJesse Vlasveld is a splendid one to beholdJesse Vlasveld is a splendid one to beholdJesse Vlasveld is a splendid one to behold
Send a message via MSN to Jesse Vlasveld Send a message via Yahoo to Jesse Vlasveld
Ever though about using lightbox?
It's sexy.

Btw Costin, you rock!
Jesse Vlasveld is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-29-2007, 10:28 AM   #9 (permalink)
Contributing Member
 
oracle's Avatar
 
Join Date: 04-23-07
Posts: 242
iTrader: 0 / 0%
oracle is liked by somebodyoracle is liked by somebodyoracle is liked by somebody
Yeah, just learned about it a couple of days ago and it's sweet! Thanks for the link though...
__________________
Web Design Company

"We all know a fool when we see one -- but not when we are one." ~ Arnold H. Glasow
oracle is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[PHP] Thumbnail Creation megamoose Coding Forum 3 11-28-2006 03:45 PM
Image Thumbnail Sketch Coding Forum 14 01-03-2006 02:59 AM
Cost per thumbnail? dismaldonkey Graphic Design Forum 6 06-25-2005 08:24 AM
php coding, java coding, webdesign, windows coding... SVB SEO Forum 5 02-24-2004 11:25 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 05:50 AM.
© Copyright 2008 V7 Inc