Results 1 to 2 of 2

Thread: This MUST be an easy fix...?

  1. #1
    Join Date
    Aug 2011

    This MUST be an easy fix...?


    I am using the following js to click on divA to fade out divB, and then click on divA again to fade in divB. It works the first time, but not the rest.

    My apologies for the terrible script (I know nothing about js), but could someone help me fix this? MANY THANKS FOR ANY HELP!

    $('#divA').click(function() {
    $('#divB').fadeOut(500, function() {
    $('#divA').click(function() {
    }); });

  2. #2
    Join Date
    Dec 2012
    Prague, Czech Republic
    Very easy ... take a look at the following.

    <!DOCTYPE html>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    <meta charset=utf-8 />
    <title>JS Bin</title>

    #divB {
    display: none;

    <script type="text/javascript">
    $(document).ready( function() {
    $('#divA').click(function() {
    $('#divB').fadeToggle("slow", "linear");
    <button id="divA">Toggle Click</button>

    <div id="divB">
    <p>This is the text for this content</p>


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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