inesgjq Posted May 14, 2021 Share Posted May 14, 2021 Site URL: https://www.inesgomez.com/mes-services Hello, I am having a problem with some CSS injecting into some particular pages. My header menu is checked to be transparent, which means that we can see the lines of code when we are at the top of my page, do you know if this can be adjusted without having to remove the transparent mode from my header menu? Link to comment
Agha_Waqas Posted May 14, 2021 Share Posted May 14, 2021 1 hour ago, inesgjq said: Site URL: https://www.inesgomez.com/mes-services Hello, I am having a problem with some CSS injecting into some particular pages. My header menu is checked to be transparent, which means that we can see the lines of code when we are at the top of my page, do you know if this can be adjusted without having to remove the transparent mode from my header menu? Hi. you need to wrap your code with <style> tag. below is a example <style>//Add CSS code here</style> Link to comment
inesgjq Posted May 15, 2021 Author Share Posted May 15, 2021 9 hours ago, Agha_Waqas said: Hi. you need to wrap your code with <style> tag. below is a example <style>//Add CSS code here</style> thank you for your answer, indeed with these tags we no longer see my lines of code, but they also no longer have an effect on my page, this line of code allowed to create a scrolling question when we clicked on the question . Now the questions are all open with the answer below. Link to comment
Agha_Waqas Posted May 17, 2021 Share Posted May 17, 2021 On 5/15/2021 at 1:03 PM, inesgjq said: thank you for your answer, indeed with these tags we no longer see my lines of code, but they also no longer have an effect on my page, this line of code allowed to create a scrolling question when we clicked on the question . Now the questions are all open with the answer below. Hi. i just noticed in developer console it shows error. will you double check in the footer section the <script> tag you are using, did you close it like this </script>. due to this markdown code is not working may be <script> //js code </script> and also i see you added the style tag around the JavaScript code. Correct code is below. copy paste below code into header page. remove yours. <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script> $(document).ready(function(){ $('.markdown-block .sqs-block-content h4').addClass('ui-closed').css('cursor','pointer'); $(".markdown-block .sqs-block-content h4").nextUntil("h4").slideToggle(); $(".markdown-block .sqs-block-content h4").click(function() { $(this).nextUntil("h4").slideToggle(); $(this).toggleClass('ui-closed ui-open'); }); }); </script> <style> .markdown-block p { margin-left:1.5em; } .markdown-block .ui-closed:before { font-family:monospace; content:"+ "; } .markdown-block .ui-open:before { font-family:monospace; content:"- "; } </style> Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment