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
turning a href off when text clicked
Old 01-10-2007, 07:22 AM turning a href off when image link clicked
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
Hi ,

I have a image with has a a href wrapped arround it.

When client clicks on the image which returns same page, i wish to turn the a href off.

How do i do this

cheers
__________________

Please login or register to view this content. Registration is FREE

Last edited by numbenator; 01-10-2007 at 07:31 AM..
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
 
Register now for full access!
Old 01-10-2007, 12:20 PM Re: turning a href off when text clicked
Oneway's Avatar
Skilled Talker

Posts: 71
Trades: 0
so then what is the function of the click?
If it's the same page that's being loaded, what changes in it that justifies the href?
Oneway is offline
Reply With Quote
View Public Profile
 
Old 01-10-2007, 12:48 PM Re: turning a href off when text clicked
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
I dont think that matters at all!

This is basically fucntionality from a drop down menu.

when i click on one image, child links are then revealed.

I simply , when these child links are returned, want to switch the a href off.
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Old 01-10-2007, 05:04 PM Re: turning a href off when text clicked
frofi's Avatar
Extreme Talker

Posts: 236
Location: London
Trades: 0
If it is the same page that should be returned, why don't you make a copy of it, only without any a href's this time, and link the image to that page instead? Problem sorted without JavaScript warnings in IE
__________________
THE FORCE is with me at last! All I need now is some TALKUPATION ;)

Last edited by frofi; 01-10-2007 at 05:06 PM..
frofi is offline
Reply With Quote
View Public Profile
 
Old 01-10-2007, 05:07 PM Re: turning a href off when text clicked
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
because i dont wont to send a request.
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Old 01-10-2007, 07:54 PM Re: turning a href off when text clicked
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
Just attach the click event to the image? That's the simpler way, get rid of the anchor all together.

Otherwise: If you attach a click event to the anchor and 'return false;' it will prevent the link from going through.
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 01-10-2007, 08:10 PM Re: turning a href off when text clicked
Oneway's Avatar
Skilled Talker

Posts: 71
Trades: 0
Simple.. Lose the href alltogether and instead attach an onclick event to the image.
In the click handler, you can then remove the event from the image.

Cross-browser event registration and deletion
Oneway is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to turning a href off when text clicked
 

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.45314 seconds with 12 queries