Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 1st, 2007, 8:19 PM   #1
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
Exclamation Dynamica links

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>
paulchwd is offline   Reply With Quote
Old Feb 2nd, 2007, 4:05 AM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 4 Arevos is on a distinguished road
var currentIndex = 0, maxIndices= 2;

function nextLink() {
    if (currentIndex <= maxIndices)
        window.location = "forsale.htm#" + currentIndex++;
}
Arevos is offline   Reply With Quote
Old Feb 2nd, 2007, 9:45 AM   #3
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
Thank a million. It worked. Im more of a java programmer then a javaScript programmer as you can see from my code. Again thanks
paulchwd is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:47 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC