/    Sign up×
Community /Pin to ProfileBookmark

Replace image with webpage instead of image??.. HELP!!

I have this script..

<script language=”JavaScript”>
<!– Begin
function movepic(img_name,img_src) {
document[img_name].src=img_src;
}
// End –>
</script>

And then the link looks like..

<a href=”#” onClick=”movepic(‘pix1′,’blahblah.jpg’)”>click me </a>

as long as the main pic is named “pix1” it works fine To replace a picture on my website with another pic when someone clicks a link or pic.

But i want it to link to another .htm in place of the picture..

<a href=”#” onClick=”movepic(‘pix1′,’blahblah.htm’)”>click me </a>

But it wont work!!!!!!! can someone help me please ????

Thanks in advance
dog812

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@bokehDec 14.2005 — I don't see why you are not using CSS for that!
Copy linkTweet thisAlerts:
@dog812authorDec 14.2005 — 2 reasons

1 i suck at CSS

and 2 i just was trying to use something simple and i already had this script.

So is there a way to make it work for me? Or another script?

If CSS would work can you post the code i need in here?
Copy linkTweet thisAlerts:
@bokehDec 14.2005 — If CSS would work can you post the code i need in here?[/QUOTE]Hmm... CSS could do it onmouseover but not onclick. Sorry if I missled you.
Copy linkTweet thisAlerts:
@dog812authorDec 14.2005 — on mouse over is fine.. can you post in here what css code i need?
×

Success!

Help @dog812 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...