Hi,
I need to add onClick and empty the href tag in an easy-slider button. I tried to play with the filter the_content, but it seams that my replace functions are overwritten.
how can i set onClick for an Easy Slider?
Thanks
Hey baaso,
I would suggest the following:
1. Enable this
2.Set a custom class to that button (ex:custom_click)
3.Add this to your theme / child theme functions.php:
function trigger_func_on_custom_button(){
?>
<script>
(function($){
$(window).load(function() {
$('.custom_click').on(function(e){
function();
});
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'trigger_func_on_custom_button');
</a>
Best regards,
Jordan Shannon
hi jordan,
thanks for the response
unfortunately, it’s not possible to set a class on a button in the simple slider (in the caption) just on the whole slider.
do you have another idea?
thanks,
Patrick
Hi,
Please enable the custom css class field: http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/ as Jordan suggested and then give your slider a custom class (“custom-slider-button” in example below) and then add following code to Functions.php file in Appearance > Editor
function av_custom_slider_attr(){
?>
<script>
jQuery(window).load(function(){
jQuery('.custom-slider-button a').attr('href','');
jQuery('.custom-slider-button a').attr('onClick','HERE GOES YOUR ON CLICK VALUE');
});
</script>
<?php
}
add_action('wp_footer', 'av_custom_slider_attr');
Best regards,
Yigit