Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. Addons
  3. Carousel: applying alt-buttons class to another class

Carousel: applying alt-buttons class to another class

Scheduled Pinned Locked Moved Addons
1 Posts 1 Posters 162 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R
    R
    Rama94
    wrote on last edited by
    #1

    Hi everyone

    I've got a Carousel slideshow where I make use of the alt-buttons function for my numbers; that's working well. Since I want my captions not beside my numbers (and I don't want a proper caption for each slide, more like a fixed title for all slides in the show), I'm dealing with the issue of how I can adapt the alt-buttons function to another element/class. I mean this is pretty simple, you only have to add the class .alt-buttons to that element. But remember that I have a fixed title that is visible through all slides; if I would add .alt-buttons to that element, the .alt-buttons class would be active for all slides. My goal is to achieve that this class is only active for those slides that have the alt-buttons function activated and not for the whole slideshow. I hope my thoughts are clear till here.

    Well, I noticed that if a slide has the alt-buttons function active, it automatically gets the class .alt-buttons; and if I swipe to the next slide – where the alt-buttons function is inactive – the class isn't added anymore. Based on this, I thought I simply have to code a jQuery which says if element "xy" has class .alt-buttons then add .highlight to class .Title and there I am. But it's not working.

    This is my carousel and below my code: https://raphaelmathias.de/projects/wp1_krizolbricht/till/

    window.laytheme.on("newpageshown", function(layoutObj, type, obj){
    		if(type == "project"){
    
    jQuery(function () {
        if (jQuery('.lay-carousel-wrap').hasClass('alt-buttons')) {
            jQuery('._Titel').addClass('highlight');
        } 
    });
    
    }
    });
    
    .highlight {
        background-color:#ff0;
    }
    

    My jQuery is working when I use the following classes .lay-carousel-slide and .lay-use-alt-buttons, but then the class .highlight is added to all slides of the slideshow and not to a certain slide.

    window.laytheme.on("newpageshown", function(layoutObj, type, obj){
    		if(type == "project"){
    
    jQuery(function () {
        if (jQuery('.lay-carousel-slide').hasClass('lay-use-alt-buttons')) {
            jQuery('._Titel').addClass('highlight');
        } 
    });
    
    }
    });
    
    .highlight {
        background-color:#ff0;
    }
    

    Any thoughts are welcome! Thanks.

    Best
    Raphael

    1 Reply Last reply
    0

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    Online Users
    Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
    laytheme.com
    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Recent
    • Tags
    • Popular
    • Users
    • Search