Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #434719

    Hi

    I want to add an image and a toggle in a table – how can I do this

    #435051

    Hi sasha!

    You should be able to use regular html in the table content:

    <img src="http://youdomain.com/yourimage.jpg">
    

    I’m not sure what you mean by toggle though?

    Cheers!
    Rikard

    #435171

    I want some content to hide and show when someone clicks a text in a table cell.

    #435186

    Hi!

    Please firstly turn on custom CSS field for ALB elements and give your button and text you would like to hide/show a custom class.
    Then please add following code to Functions.php file in Appearance > Editor

    function add_custom_cs(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery(".your-hidden-text").hide();
    jQuery( ".your-custom-button-class" ).click(function() {
      jQuery( ".your-hidden-text" ).toggle();
    });
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_cs');

    If that does not help, please post the link to your page and a screenshot showing the changes you would like to make.

    Best regards,
    Yigit

    #435251

    Hi Yigit,

    It works great! but there’s a problem:

    I have more then one row with this action and when I click one cell all the hidden texts show instead of just the one I clicked. Any way to solve this?

    And one more thing – when the page loads – the hidden text is visible for a second and then disappears – any way to prevent this?

    Many Thanks

    #435258

    Hey!

    Please change the code to following one

    function add_custom_cs(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery( ".your-custom-button-class" ).click(function() {
      jQuery( ".your-hidden-text" ).toggle();
    });
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_cs');

    and add following code to Quick CSS field

    .your-hidden-text { display: none; }

    Can you please post a screenshot and a link to your website so we can understand the changes you would like to make better?

    Cheers!
    Yigit

    #435332
    This reply has been marked as private.
    #435359

    Hi!

    Can you please point out the text we should click? My Hebrew is limited to basic words unfortunately :)

    Best regards,
    Yigit

    #435360
    This reply has been marked as private.
    #435364

    Hey!

    Do you mind creating a temporary admin login and posting it here privately so we can look into it?

    Regards,
    Yigit

    #435387

    where you able to see the problem?

    #435393

    Hi!

    Yes, i was. If you would not like to post login credentials, we can post other codes to try to solve it. Just thought it would be faster.

    Best regards,
    Yigit

    #435397
    This reply has been marked as private.
    #435409

    Hey!

    Can you please try changing the code to following one

    function add_custom_cs(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery( ".coursetitle" ).click(function() {
      jQuery(this).closest("p span").find(".courseinfo").toggle();
    });
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_cs');

    Cheers!
    Yigit

    #435425
    This reply has been marked as private.
    #435456
    This reply has been marked as private.
    #435466

    Hey!

    Great! Bevakasha, glad we could help :)

    Cheers!
    Yigit

Viewing 17 posts - 1 through 17 (of 17 total)
  • The topic ‘Toggle inside a table’ is closed to new replies.