SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    724
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    why is my simple "hide" button not kicking in?

    Hello all working on this test site. but even in my sandbox the hide button is not working. I went over the jquery, looked for possible typos ect.
    (didn't post this the javascript/jquery section as this is on wp & it should actually be pretty basic, so hope it is ok here.)
    thx
    D

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,606
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    Is this "hide" button from a plugin, or something of your own making? Is it on the front-end of the wordpress site, or the administrative back-end?

    Go ahead and post the code you're working with. This will aid in troubleshooting if it's your own code.
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  3. #3
    SitePoint Addict
    Join Date
    Oct 2008
    Location
    Virtual World is my location
    Posts
    308
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Without the code it would not be possible to troubleshoot but 1 mistake that usually happens in case of WP is that many a times the jquery javascript is put before even calling jquery so sometimes it does not work as it does not find jquery files. So if you can post that section it would be easier to help out
    RecipesNext.com - recipes, kitchen queries, videos & more...
    BargainNext.com - coupons / deals / bargains / offers & more...

  4. #4
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    724
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hello all and thank you, my code & button is at http://danielamorescalchi.com/test01/
    button is now on display:none; but it is right below the blue band beneath the menu.

    so i have
    Code:
    <div class="hideBtn">
    		<a href="#" title="hide welcome msg">Hide</a>
    	</div>
    in the welcome.php page

    I then have on the same page
    Code:
    <script>
    JQuery(document).ready(function($){
    	$(".hideBtn a").click(function(){
    		$("#frontPageIntro").slideToggle('slow');
    		$(this).text($(this).text() == 'Show' ? 'Hide' : 'Show');
    		return false;
    	});
    });
    </script>
    after having tried to use that script in a custom .js file in the js folder.

  5. #5
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,873
    Mentioned
    208 Post(s)
    Tagged
    12 Thread(s)
    Hi there,

    On the page you link to, if you look at the error console in your browser (how do I do that) then you'll see this:

    Code:
    Uncaught ReferenceError: JQuery is not defined danielamorescalchi.com/:119
    This message usually means that you are trying to use jQuery before you have included it.

  6. #6
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    724
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    hi there. thank you Pullo will go check that out.

  7. #7
    SitePoint Addict
    Join Date
    Oct 2008
    Location
    Virtual World is my location
    Posts
    308
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    hi @pdxSherpa

    I checked your code and its nothing to do with your script. Its a known bug in jQuery.

    Kindly try downloading the release version or try referring

    Code:
    http://code.jquery.com/jquery-git1.js
    - the latest build in progress and your issue will be solved

    Also just to let you know one minor issue

    Code:
    JQuery(document).ready
    the j should be small in JQuery so it should be like
    Code:
    jQuery(document).ready
    Last edited by jaagare; Jan 7, 2014 at 21:10. Reason: code typo fixed.
    RecipesNext.com - recipes, kitchen queries, videos & more...
    BargainNext.com - coupons / deals / bargains / offers & more...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •