Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #208562

    Andrew M
    Participant

    Hi there,

    I’ve been struggling a bit to get some custom jQuery to work, it’s a pretty simple piece of code to get a background color of an element to change when I mouse over a div on this page: http://www.murphydave.co.uk/newmdawebsite/about-us-2/

    This is the code I’m using (i’ve put it in the customiser’s javascript box):

    jQuery(document).ready(function(){
    $(document).ready(function() {
    $(‘.scrollable’).mouseenter(function() {
    $(‘.scrollable > div > div > div > .jspDrag’).css(‘background-color’, ‘#c6c6c6’);

    });
    });
    });

    But even when I try something simple like:

    jQuery(document).ready(function(){
    $(document).ready(function() {
    $(‘p’).hide();
    });
    });

    Nothing seems to happen, am I doing something wrong?

    Thanks for your help, really enjoying using the theme!

    Andrew.

    #208744

    Zeshan
    Member

    Hi Andrew,

    Thanks for writing in!

    Your website is having a JS conflict, upon checking, it seems you are using pretty single quotes that are causing this conflict (see: http://prntscr.com/66dvd7). So make sure to replace the pretty quotes from your custom jQuery code with normal quotes. So the current code in your custom JS section would become:

    jQuery(document).ready(function($) {
       $('#resize-text').mouseenter(function() {
          $(this).css('color', 'red');
       });
    });
    

    Cheers!

    #209600

    Andrew M
    Participant

    Thanks! That’s good to know (didn’t realise I had my quotes default as ‘pretty’ ones).

    Andrew.

    #209850

    Darshana
    Moderator

    Glad we were able to help 🙂

    #635524

    fleye
    Participant

    Hi,

    I’m trying to have a partly one page set up but partly other pages. I have the menu working but the 2 menu options that are suppose to link back to the 1 page don’t work from the other pages. I have tried using the code suggested and then the full URL but it doesn’t seem to be working. I wonder if I have got the URL wrong?

    I am looking for ‘show reel’ and ‘get in touch’ to be on the main page.

    http://www.flyaerial.co.uk

    #635592

    Jack
    Keymaster

    Hi there @fleye,

    Hope you’re well today and thanks for writing in.

    I’ve checked your site and get a 500 internal server error when visiting the show reel link and it also goes to load https, we do have a guide here on setting up one page navigation: https://community.theme.co/kb/how-to-setup-one-page-navigation/

    As the issue here looks quite a bit different than the original issue in this thread, can you start a new topic please and we’ll be right along to assist. 🙂

    Thank you!