javascript - Don't want page jump -


previous problam solved @ use selectors in variable jquery on same coe

i have made functionality this using big jquery code didn't understand

and here jsfiddle have make same functionality when clicked page jumps element dont want page jump need fadein , out

$(".show").click(function() {     var link = $('this').attr('href');   $(link).show();  });  $(".close").click(function() {   $(this).closest("div.popupbox").hide(); }); 

and html

<a href="#popup" id="show" class="show">a</a> <a href="#popup1" id="show1" class="show">b</a> <a href="#popup2" id="show2" class="show">c</a> 

i want show #popup on anchor click dont want page jump/scroll id have given top:10000px in fiddle testing issue because in original page moves particular element

full code on fiddle , want this functionality

try one:

$(".show").click(function(e) {   e.preventdefault();   var link = $(this).attr('href'); //<----remove quotes in $('this')   $(link).fadein(); // <-------------use fadein() instead });  $(".close").click(function(e) {   e.preventdefault();   $(this).closest("div.popupbox").hide(); }); 

and adjust top:100000px lesser 1 50px


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -