Lay Theme Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Carousel: applying alt-buttons class to another class

    Addons
    1
    1
    17
    Loading More Posts
    • 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
      Rama94 last edited by

      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 Reply Quote 0
      • First post
        Last post

      Before you post

      Use the Search Feature. Maybe there is already a solution to your issue.

      1. Update Lay Theme and all Lay Theme Addons
      2. Disable all Plugins
      3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
      4. Now see if your problem solved itself
      5. Go here, see if your problem is listed here:
      Troubleshooting

      When you post:
      1. Post a link to where the problem is
      2. If the problem is difficult to explain, post screenshots / link to a video to explain it

      Thanks!

      Online Users

      S

      Recent Topics

      • T

        OpenType Feature

      • T

        Split Screen just on front page / subpages without the split?

      • T

        problem when I click on the category filter buttons on mobile

      • G

        z index has different behaviors on different pages

      laytheme.com