attaching preventDefault; to .live('click', function( )
-
16-06-2021 - |
Domanda
i keep getting a sytax error when trying to add (function (e) {
e.preventDefault;
to
$("#pegasus-tile, #o-w, #next-pidu, #prev-bgapp").live('click', function() {
$("#proj-content").load("projects/pegasus.html", function() {
$('<div id="slider" class="nivoSlider"></div>');
$('#slider').nivoSlider({
effect: 'sliceUpDown'
});
});
});
im not sure how to combine it when using .live
, i know its somthing really simple but i just cant get it, any helps much apreciated
Soluzione
Its simple:
$("#pegasus-tile, #o-w, #next-pidu, #prev-bgapp").live('click', function( e ) {
e.preventDefault();
$("#proj-content").load("projects/pegasus.html", function() {
$('<div id="slider" class="nivoSlider"></div>');
$('#slider').nivoSlider({
effect: 'sliceUpDown'
});
});
});
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow