• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • Last Modified:

Wordpress and JQuery

For some reason the following two pieces of script stopped working.  Are they formatted correctly to work with wordpress?

<script type="text/javascript">
jQuery(document).ready(function($) {
    $("#menu-menu-2").hide();
    $(".mtoggle").click(function() {
        $("#menu-menu-2").slideToggle(500);
    });
});
</script>

<script type="text/javascript">
jQuery(document).ready(function($){  

    $(".addon-28-bicycle-info[value-of-accesories]").keyup(function(){
    $(".product-addon-xl-tall-depend").show('slow');
	});
	
	$("#get_empty_quote").click(function()	{
	$("#empty_quote_title").hide(2300);
	});
});
</script>	

Open in new window

0
rgranlund
Asked:
rgranlund
  • 3
  • 3
1 Solution
 
GaryCommented:
Look fine, do you have a link to look at?
0
 
Jason C. LevineNo oneCommented:
Concur, that should work.

Is prototype being called?
0
 
rgranlundAuthor Commented:
spokeinsurance.com/index

If you reduce the browser size, the menu does not collapse.  When you enter a value, email and state it does not validate that info.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
GaryCommented:
You have jquery included twice - remove one of the references

Secondly you are referencing $ without passing it into the function
$( ".my-contract" ).click(function() {

The we'll go from there.
0
 
rgranlundAuthor Commented:
I don't understand what this means?
Secondly you are referencing $ without passing it into the function
$( ".my-contract" ).click(function() {
0
 
GaryCommented:
	<script>
		// you need to pass $ into the function here
		//jQuery( document ).ready(function() { // this is wrong
		jQuery( document ).ready(function($) { // this is correct
		$( ".my-contract" ).click(function() {
			$( "#my_contract" ).show("slow");
			$( ".print-declaration").show("slow"); 
		});
	});
	</script>

Open in new window

0
 
rgranlundAuthor Commented:
AHHHHH!
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now