P
P
pahanmcs2019-04-24 00:48:27
JavaScript
pahanmcs, 2019-04-24 00:48:27

What is the script conflict?

the script on one page does not work on the site here , when you click on the red + button, the spoiler should open, the script is inserted in the template before the closing body:

<script type="text/javascript">
$('.opening2').click(function(){
$(this).parent().children('div.sp2').toggle('normal');
return false;
});
</script>

works on other pages without filter
If you disable one of the scripts on which the filter works, the script is executed, but the filter does not work either:
$this->document->addScript('catalog/view/javascript/jquery/jquery.tmpl.min.js');
        $this->document->addScript('catalog/view/javascript/jquery/jquery.deserialize.min.js');
        $this->document->addScript('catalog/view/javascript/jquery/jquery.loadmask.min.js');
        $this->document->addScript('catalog/view/javascript/jquery/jquery.lazyload.min.js');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Proskurin, 2019-04-24
@pahanmcs

I see that after the page is loaded, all catalog items are re-rendered (probably the filter does this), which means that all event handlers are lost.
You can write like this

$('.content').on('click', '.opening2', function(){
    $(this).parent().children('div.sp2').toggle('normal');
    return false;
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question