Help! Sticky element doesen't work for me...
-
-
So what you'd need to do is, you click the point using javascript.
i can't open the site anymore:
https://www.secretsfilms.com/site/en/alexis_taule_home-copy/but basically what you do is
<script> window.laytheme.on('newpageshown', function(){ jQuery('a[data-expand="39"]').click() }) </script>Enter this css in "lay options" -> "custom css & html" -> "custom head content"
obviously you can't use 'a[data-expand="39"]'
instead, you need to find out the correct data-expand id by using inspect element

-
Hey,
if I put the script:<script>
window.laytheme.on("newpageshown", function() {
jQuery('a[data-expand="13"]').click()
});
</script>page don't load. Only the menu is visible and the error in console says:
[Error] TypeError: undefined is not an object (evaluating 'Gs.find')
(anonymous function) (frontend.app.min.js:1:238436)
dispatch (jquery.min.js:2:40041)
trigger (jquery.min.js:2:70130)
(anonymous function) (jquery.min.js:2:70734)
each (jquery.min.js:2:3134)
(anonymous function) (alexis_taule_home-copy:2773)
emit (events_channels.min.js:1:1741)
(anonymous function) (frontend.app.min.js:1:302722)Any idea? Thanks in advance
-
-
<script> window.laytheme.on('newpageshown', function(){ if(jQuery('a[data-expand="13"]').length > 0){ jQuery('a[data-expand="13"]').click(); } }) </script>the website seems to be online again.
the above should be the correct code. i included a check, and i inserted the correct idi think this code is wrong:
<script>
window.laytheme.on("newpageshown", function() {
jQuery('body.type-project.id-801 .btn_accion').trigger('click');
});
</script>can you use my code above and show a screenshot where you added it
-
After put your code, console says:
[Error] TypeError: undefined is not an object (evaluating 'Gs.find')
(anonymous function) (frontend.app.min.js:1:238436)
dispatch (jquery.min.js:2:40041)
trigger (jquery.min.js:2:70130)
(anonymous function) (jquery.min.js:2:70734)
each (jquery.min.js:2:3134)
(anonymous function) (alexis_taule_home-copy:2797)
emit (events_channels.min.js:1:1741)
(anonymous function) (frontend.app.min.js:1:302722)In the screenshot you see where I added the code.

-
can you update lay theme now and try if it works now?
i think now you shouldnt get the error anymore.seems like there was an issue with the compatibility of lay theme's code and the code i gave you
-
-
<script> window.laytheme.on('newpageshown', function(){ if(jQuery('a[data-expand="13"]').length > 0){ setTimeout(function(){ console.log("hello!") jQuery('a[data-expand="13"]').click(); }, 1000) } }) </script>seems that with the new update and this timeout it works
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login