The script should check the document every time the user clicks a link. If the href
is #, the script should show a div with the ID video.
(I need this specific piece as a patch for an image gallery. I'm having trouble using the title
attribute for specific content for different images in the gallery.)
Pseudo code:
If user clicks <a> with href="#"
Show div #video
The script should check the document every time the user clicks a link. If the href
is #, the script should show a div with the ID video.
(I need this specific piece as a patch for an image gallery. I'm having trouble using the title
attribute for specific content for different images in the gallery.)
Pseudo code:
If user clicks <a> with href="#"
Show div #video
Share
Improve this question
edited Dec 22, 2012 at 23:53
mjk
2,4534 gold badges34 silver badges33 bronze badges
asked Nov 26, 2010 at 10:44
TomkayTomkay
5,16021 gold badges65 silver badges94 bronze badges
1
- No. - I mean href="#" nothing else^^ – Tomkay Commented Nov 26, 2010 at 10:49
5 Answers
Reset to default 3$('a[href="#"]').click(function(){
$("#video").show();
});
$('a[href="#"]').click(function(){
$("#videoDiv").show();
});
$('a[href="#"]')
Then do your show div!
you can use $('a[href=#]').click(myFunction);
Try this:
$('a[href$=#]').click(function(e){
$("#video").show();
e.preventDefault();
return false;
});