Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter themeply

    (@themeply)

    One more thing.. I want to interact with the elements in the site preview iframe.

    If I add the following line to hide the #site-title element, nothing happens:

    $(“#site-title”).hide();

    jQuery(document).ready(function($){
    	setTimeout(function() {
    		$($("#customize-control-blogname")).hover(function(){
    			alert("hover!");
    			$("#site-title").hide();
    		}, function (){
    			alert("unhover!");
    		});
    	}, 3000);
    });

    I’m guessing it’s beyond the scope of the customizer section?

    Thread Starter themeply

    (@themeply)

    The last code block worked for me. Thank you so much Grigory!

    Thread Starter themeply

    (@themeply)

    Full code of my-unique-script.js:

    jQuery(document).ready(function($){
       var element = $("#customize-control-blogname");
       alert(typeof(element));
    
       $("#customize-control-blogname").hover(function(){
          alert("hover!");
       });
    
    });
    Thread Starter themeply

    (@themeply)

    Thank you again for your response Grigory.

    When I add the code:

    `
    jQuery(document).ready(function($){
    var element = $(“#customize-control-blogname”);
    alert(typeof(element));
    });’

    It alerts ‘object’, so I guess that’s what it should be showing.

    I still can’t get the alert to fire when I mouse/hover over the ‘Site Title’ list item as seen in customizer http://i.imgur.com/8kfGb1u.png

    Thread Starter themeply

    (@themeply)

    Thanks for your reply Grigory.

    I’m still not able to get the alert to fire when hovering over li#customize-control-blogname

    I’m sure the JS is loading because if I change the element selector to #site-title (which I have in the header of theme shown in customizer preview) the alert shows. Any other idea? Thank you very much.

Viewing 5 replies - 1 through 5 (of 5 total)