treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[solved] Chris' 'anything slider' how to remove numbers

  • I want the link to be there but not the numbers. Don't know Jquery yet. Hoping for some advice Thanks.

    <http://s70539.gridserver.com/index.php#panel-1&gt;

    Here is the portion of the code that I think needs to be changed:

     // Creates the numbered navigation links
    base.buildNavigation = function(){
    base.$nav = $(\"<div id='thumbNav'></div>\").appendTo(base.$el);
    base.$items.each(function(i,el){
    var index = i + 1;
    var $a = $(\"<a href='#'></a>\");
  •    $(function () {

    $('#slide-jump')&#46;anythingSlider({
    easing&#58; &quot;easeInOutExpo&quot;, // Anything other than &quot;linear&quot; or &quot;swing&quot; requires the easing plugin
    autoPlay&#58; true, // This turns off the entire FUNCTIONALY, not just if it starts running or not&#46;
    delay&#58; 10000, // How long between slide transitions in AutoPlay mode
    startStopped&#58; false, // If autoPlay is on, this can force it to start stopped
    animationTime&#58; 600, // How long the slide transition takes
    hashTags&#58; true, // Should links change the hashtag in the URL?
    buildNavigation&#58; false, // If true, builds and list of anchor links to link to each slide
    pauseOnHover&#58; true, // If true, and autoPlay is enabled, the show will pause on hover
    startText&#58; &quot;Go&quot;, // Start text
    stopText&#58; &quot;Stop&quot;, // Stop text
    navigationFormatter&#58; formatText // Details at the top of the file on this use (advanced use)
    });
    });

    I've changed "buildNavigation" to false.
  • I changed it to false and nothing seems to happen. Even if it did wouldn't it remove the buttons altogether? I want the circles to stay. I just want the numbers removed.
  • $(&quot;#thumbNav a&quot;)&#46;text('');

    That will remove the text.
  • Thanks jamy_za.

    Sorry for the ignorance. Where do I put that line?
  • 99% of the time, things go within:
    $(function () {
    // Content goes here
    });

    Or within
    $(document)&#46;ready(function () {
    // Content goes here
    });

    The first is just a shorthand version of the second.

    I would put it right at the bottom of the javascript you pasted earlier:
    $(function () {

    $('#slide-jump')&#46;anythingSlider({
    easing&#58; &quot;easeInOutExpo&quot;, // Anything other than &quot;linear&quot; or &quot;swing&quot; requires the easing plugin
    autoPlay&#58; true, // This turns off the entire FUNCTIONALY, not just if it starts running or not&#46;
    delay&#58; 10000, // How long between slide transitions in AutoPlay mode
    startStopped&#58; false, // If autoPlay is on, this can force it to start stopped
    animationTime&#58; 600, // How long the slide transition takes
    hashTags&#58; true, // Should links change the hashtag in the URL?
    buildNavigation&#58; false, // If true, builds and list of anchor links to link to each slide
    pauseOnHover&#58; true, // If true, and autoPlay is enabled, the show will pause on hover
    startText&#58; &quot;Go&quot;, // Start text
    stopText&#58; &quot;Stop&quot;, // Stop text
    navigationFormatter&#58; formatText // Details at the top of the file on this use (advanced use)
    });

    $(&quot;#thumbNav a&quot;)&#46;text('');
    });
  • Man, thanks again for all the help. I must be doing something wrong.

    I put it in like below and nothing changed. Guessed at a couple of changes and they either had no effect or broke the whole thing.

      $&#46;anythingSlider&#46;defaults = {
    easing&#58; &quot;swing&quot;, // Anything other than &quot;linear&quot; or &quot;swing&quot; requires the easing plugin
    autoPlay&#58; true, // This turns off the entire FUNCTIONALY, not just if it starts running or not
    startStopped&#58; false, // If autoPlay is on, this can force it to start stopped
    delay&#58; 3000, // How long between slide transitions in AutoPlay mode
    animationTime&#58; 600, // How long the slide transition takes
    hashTags&#58; true, // Should links change the hashtag in the URL?
    buildNavigation&#58; false, // If true, builds and list of anchor links to link to each slide
    pauseOnHover&#58; true, // If true, and autoPlay is enabled, the show will pause on hover
    startText&#58; &quot;Start&quot;, // Start text
    stopText&#58; &quot;Stop&quot;, // Stop text
    navigationFormatter&#58; null // Details at the top of the file on this use (advanced use)
    };

    $(function () {
    $(&quot;#thumbNav a&quot;)&#46;text('');
    });


    $&#46;fn&#46;anythingSlider = function(options){
    if(typeof(options) == &quot;object&quot;){
    return this&#46;each(function(i){
    (new $&#46;anythingSlider(this, options));
  • I went to your site and had a look at the current javascript. You have this:
    			$(document)&#46;ready(function(){
    $('#still a')&#46;click(function(){
    $('#still')&#46;hide();
    $('#video')&#46;show();
    });
    });

    Replace it with this:
    $(document)&#46;ready(function(){
    $('#still a')&#46;click(function(){
    $('#still')&#46;hide();
    $('#video')&#46;show();
    });
    $(&quot;#thumbNav a&quot;)&#46;text('');
    });

    The only difference is the little bit at the bottom. I've just added spacing to make it more readable.
  • Worked!

    Thanks so much.

    Jeane
  • Easier fix: the ul is a span, so to solve by css just add

    div.anythingSlider .anythingControls ul a span {
    display: none;
    }