1

I´m trying to prevent click on the .thumbNav li navigation using this

$('.anythingSlider').delegate('.thumbNav li','click', function(){
   return false;
});

But it just wont work??

I quess there is a function in the script that binds the click event and perhaps that is i problem?

Perhaps there is a way to override that feature?

Edit: Im running this function on the "onInitialized" callback

This is the HTML:

<ul class="thumbNav" style="">
  <li class="first">
    <a class="panel1 cur" href="#">
        <span>0</span>
    </a>
  </li>
  <li>
    <a class="panel2 disabled" href="#">
        <span>1</span>
    </a>
  </li>
  <li>
    <a class="panel3 disabled" href="#">
        <span>2</span>
    </a>
  </li>
  <li>
    <a class="panel4 disabled" href="#">
        <span>3</span>
    </a>
  </li>
  <li class="last">
    <a class="panel5 disabled" href="#">
        <span>4</span>
    </a>
  </li>
</ul>​

hmmm.. acctually this works in crome (but not ff or ie):

$('.thumbNav li a').bind('click', function(){ 
   return false;
});
4

2 に答える 2

0

try

$('.anythingSlider').delegate('.thumbNav li a','click', function(){
return false;
});

hope this will work...

于 2012-05-24T08:02:04.530 に答える
0

Just set the enableNavigation option to false (demo)

$('#slider').anythingSlider({
    // if false, navigation links will still be visible, but not clickable.
    enableNavigation: false,
});​

Alternatively, you could set the clickControls option to an empty string:

$('#slider').anythingSlider({
    // Events used to activate navigation control functionality
    clickControls: "" // default is "click focusin"
});​
于 2012-05-24T17:17:13.807 に答える