Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
javascript picture show
Old 03-02-2007, 07:18 AM javascript picture show
Experienced Talker

Posts: 39
Name: Rob
Trades: 0
Im trying to put together a picture gallery using asp and javascript i want to use a repeat region all my files are showing but when i click the thumb nail the large image is not changing to the thumbnail i want to view any know what ive done wrong?



</script>
</head>

<p><img src="../../images/uploadedFiles/<%=(rs1.Fields.Item("Filename").Value)%>" name="large" width="300" height="200" border="0" align="middle"></p>
<p> </p>
<p> </p>


<table>
<%
startrw = 0
endrw = HLooper1__index
numberColumns = 3
numrows = -1
while((numrows <> 0) AND (Not rs1.EOF))
startrw = endrw + 1
endrw = endrw + numberColumns
%>
<tr align="center" valign="top">
<%
While ((startrw <= endrw) AND (Not rs1.EOF))
%>
<td><p> <a href="javascript:image_click(0)"><img src= width="150" height="110" name="pimage0" border=0></a>
<!---- THESE BLOCKS OF CODE CONTROL HOW THE IMAGES ARE DISPLAYED-->
<script language="JavaScript"><!--
//thumbnail script
image0 =new Image();



// These 3 lines define the source of the displayed images
image0.src ="../../images/uploadedFiles/<%=(rs1.Fields.Item("Filename").Value)%>"


// This defines the source of the preview image
document.images['pimage0'].src=image0.src;


// This defines what to do when an image is clicked on
function image_click(clicks)
{
if(clicks==0){document.images['large'].src=image0.src;}
}
// --></script>
starsearch is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-03-2007, 05:18 AM Re: javascript picture show
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
need to see the rendered page. do we get a URL ?

but at a guess you probably have several image0's dotted around the page.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-03-2007, 06:38 AM Re: javascript picture show
greenlush's Avatar
Ultra Talker

Posts: 481
Name: Jason - Greenlush.com
Location: Bradford, UK
Trades: 0
yeah do you have a test URL i can see
greenlush is offline
Reply With Quote
View Public Profile Visit greenlush's homepage!
 
Old 03-03-2007, 09:41 AM Re: javascript picture show
Experienced Talker

Posts: 39
Name: Rob
Trades: 0
http://www.starsearchentertainment.c...asp?peopleID=1
starsearch is offline
Reply With Quote
View Public Profile
 
Old 03-03-2007, 02:06 PM Re: javascript picture show
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
for a start you need to learn how to optimise images for thumbnails DO NOT simply cram them into a sized element

But yep, exactly as I expected every thumbnail image is named "pimage0" every javascript reference is image0 and every clickevent is "javascript:image_click(0)"

so the script function has no idea which of these you are referencing

Write the code loop to do this by hand rather than having Dreamweaver £#() it up.

And it's an ASP issue
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to javascript picture show
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31484 seconds with 12 queries