![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Mar 2005
Posts: 139
Rep Power: 4
![]() |
Hello All,
I need the user to click on an image and when the click the on that image, a javaScript (or vbScript for that matter-- i dont care which language) function executes which sets the value of this link the idea being every click of the image increments a variable and then that variable is concatenated with a string of the page i want it to go to (the variable's contents will represent an ancore on a page ) code : <html>
<head>
<script language=javaScript>
<!--
var details=0, numImgs=2, link;
function string details()
{
while( details <= numImgs)
{
details++;
link= "forsale.htm#"+details;
return link;
}
}
//-->
</script>
</head>
<body>
<a href="javascript: details()"><img src=test.jpg"></a>
</body>
</html> |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
var currentIndex = 0, maxIndices= 2;
function nextLink() {
if (currentIndex <= maxIndices)
window.location = "forsale.htm#" + currentIndex++;
} |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Mar 2005
Posts: 139
Rep Power: 4
![]() |
Thank a million. It worked. Im more of a java programmer then a javaScript programmer as you can see from my code. Again thanks
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How many links do I need? | DavidL | Coder's Corner Lounge | 3 | Sep 16th, 2006 7:05 PM |
| PFO Links within applications. | john Wesley | Coder's Corner Lounge | 5 | Aug 1st, 2006 9:14 AM |
| php tutorial links | bulio | PHP | 7 | Feb 26th, 2006 1:33 PM |
| PFO Style Site Navigation Links | B3TA_SCR1PT3R | Community Announcements and Feedback | 3 | Jan 17th, 2006 10:37 PM |