himynameismark Posted August 1, 2010 Share Posted August 1, 2010 I have some code that works on the TryIt Editor on w3schools.com, but I took the same code and literally copy/pasted it into my code, and changed the selectors to the correct information on my page. For some reason, it is not working. I have jQuery imported onto the page in the head. I have other JavaScript files that are working, too.Here is my code: $(document).ready(function(){ //Hide Form $("#blogForm").hide(); //Toggle Form $("button").click(function(){ $("#blogForm").slideToggle("slow"); });}); Like I said, this works perfectly well in the TryIt Editor, but will not work at all on my website. Literally the only thing that is different is the "#blogForm" selector. It was "p" in the editor. I have tried this in both internal and external JavaScript.I had a code working that would switch between two divs on another page. I want that code to do a horizontal slide toggle, but I have no idea where to even start with that. The code for that page is just changing the CSS content right now. It works, but it's not as smooth looking as I want it.If anybody could help me out with these codes, I would greatly appreciate it!Thanks in advance,Mark Link to comment Share on other sites More sharing options...
Ingolme Posted August 1, 2010 Share Posted August 1, 2010 Are you including the jQuery library on your site as well? Link to comment Share on other sites More sharing options...
himynameismark Posted August 1, 2010 Author Share Posted August 1, 2010 Are you including the jQuery library on your site as well?Yes, I have a jQuery folder with both jquery-1.4.2.min.js and jquery-1.4.2.js in it. I had only jquery-1.4.2.min.js at first, so I included the other one as well. For the time being, they are both included and still nothing is happening.On the page where I had the div switch code, I only have jquery-1.4.2.min.js included. So I can change CSS content with no issue, but I can't do a slideToggle. Link to comment Share on other sites More sharing options...
ApocalypeX Posted August 1, 2010 Share Posted August 1, 2010 Is your jQuery script above this code?Also it would help if you ran the page and copied and pasted what the error console says. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.