Link within a clickable div.
Hi guys,
I have a clickable div. Within this div is some text. I made a link at the and "- read more -" which shows extra text and hides the previous text. When this link, which is inside the div, is clicked I dont want the div to respond to the click. I used "event.stopPropagation();" for that. So far so good.
However after you clicked on the link and the extra text is shown I dont want the div to react to clicks anymore. Since this would trigger the original text to be shown.
I hope you understand my problem. Any help would be much appreciated!
- <script>
- $(".readmore").click(function(event) {
- $("#originaltext").hide();
- $("#header1").hide();
- $("#moretext").show();
- })
- $('.readmore').click(function(event){
- event.stopPropagation();
- });
- </script>
- <script>
- $("#services").click(function(){
- $("#services").animate({
- width: "350px",
- height: "320px",
- borderWidth: "10px",
- position: "absolute",
- top: "255px",
- left: "50px"
- }, 1500,
- function() {
- $("#originaltext").show();
- }
-
- )
- </script>
Cheers,
Ziggy