Note that there are some explanatory texts on larger screens.

plurals
  1. POAddclass is not a function in jQuery
    primarykey
    data
    text
    <p>I have a mouseover function that should add a class to my viewport element, but i get an error in firebug when I mouseover: TypeError: jQuery(...).addclass is not a function.</p> <p>the HTML is: </p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="&lt;?php bloginfo( 'charset' ); ?&gt;" /&gt; &lt;title&gt;&lt;?php wp_title('|','true','right'); ?&gt;&lt;?php bloginfo('name'); ?&gt;&lt;/title&gt; &lt;meta name="viewport" content="width=device-width" /&gt; &lt;link rel="stylesheet" type="text/css" media="all" href="&lt;?php bloginfo( 'stylesheet_url' ); ?&gt;" /&gt; &lt;?php wp_head(); ?&gt; &lt;/head&gt; &lt;body &lt;?php body_class($class); ?&gt;&gt; &lt;header&gt; &lt;div class="main-logo"&gt; &lt;div id="site-title"&gt; &lt;/div&gt;&lt;!--.site-title--&gt; &lt;/div&gt;&lt;!--main-logo--&gt; &lt;div class="header-right"&gt; &lt;/div&gt;&lt;!--header-right--&gt; &lt;/header&gt; &lt;nav class="main"&gt; &lt;?php wp_nav_menu( array( 'theme_location' =&gt; 'main-menu' ) ); ?&gt; &lt;/nav&gt; &lt;div class="viewport"&gt; &lt;script type="text/javascript"&gt;&lt;!--//--&gt;&lt;![CDATA[//&gt;&lt;!-- jQuery(document).ready(function(jQuery){ jQuery('nav .home a').mouseover(function() { jQuery('.viewport').addclass('.viewporthome'); }); }); //--&gt;&lt;!]]&gt;&lt;/script&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>The related styles are:</p> <pre><code> .viewport { height: 400px; width: 400px; position: relative; top: -90px; margin: 0 auto; } .viewporthome { background-image: url('images/Screen2.png'); background-repeat: no-repeat; background-position: center; background-attachment: relative; } </code></pre> <p>The JS file is:</p> <pre><code> var hoverhome = 'url("images/Screen2.png")'; var empty = ''; var success = 'SUCCESS!'; //home jQuery('nav .home a').hover(function() { jQuery('.viewport').css('background-image', hoverhome); }); jQuery('nav .home a').mouseout(function() { jQuery('.viewport').css('background-image', empty); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload