-
AuthorPosts
-
April 25, 2015 at 5:31 pm #434719
Hi
I want to add an image and a toggle in a table – how can I do this
April 27, 2015 at 7:21 am #435051Hi 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!
RikardApril 27, 2015 at 12:29 pm #435171I want some content to hide and show when someone clicks a text in a table cell.
April 27, 2015 at 12:53 pm #435186Hi!
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 > Editorfunction 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,
YigitApril 27, 2015 at 2:16 pm #435251Hi 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
April 27, 2015 at 2:21 pm #435258Hey!
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!
YigitApril 27, 2015 at 3:58 pm #435332This reply has been marked as private.April 27, 2015 at 4:15 pm #435359Hi!
Can you please point out the text we should click? My Hebrew is limited to basic words unfortunately :)
Best regards,
YigitApril 27, 2015 at 4:16 pm #435360This reply has been marked as private.April 27, 2015 at 4:19 pm #435364Hey!
Do you mind creating a temporary admin login and posting it here privately so we can look into it?
Regards,
YigitApril 27, 2015 at 4:35 pm #435387where you able to see the problem?
April 27, 2015 at 4:37 pm #435393Hi!
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,
YigitApril 27, 2015 at 4:40 pm #435397This reply has been marked as private.April 27, 2015 at 4:53 pm #435409Hey!
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!
YigitApril 27, 2015 at 5:04 pm #435425This reply has been marked as private.April 27, 2015 at 5:36 pm #435456This reply has been marked as private.April 27, 2015 at 5:54 pm #435466 -
AuthorPosts
- The topic ‘Toggle inside a table’ is closed to new replies.