Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8442145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:46:17+00:00 2026-06-10T08:46:17+00:00

I am using this javascript/jquery to hide a part of my page and show

  • 0

I am using this javascript/jquery to hide a part of my page and show a new part. It was working yesterday, and then I came on today and its not working. I did some editing such as adding a “snowing” javascript, and a javascript code that changes the bg color on the click of a button, but I removed everything I changed, and it still doesn’t work… Here is my whole code…

<html><head>

     <script src="http://code.jquery.com/jquery-latest.js"></script>
        <link href="http://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet" type="text/css" >
<script type="text/javascript"> <!-- Hides something then shows something. -->
function friedrice(id, id2) {
     $('#' + id).hide(); 
     $('#' + id2).show(); 

}
</script>


<script type="text/javascript"> <!-- Show stuff with fade in -->
    function showStuff(id) {
        document.getElementById(id).style.display = 'block';
object = document.getElementById(id)

$(object).hide();
        $(object).fadeIn(1000);
    }
</script>




<script type="text/javascript"> <!-- Hides hidden stuff on load -->

$(document).ready(function(){ 
    $('#swf').hide(); 
    $('#surprise').hide();
}); 

</script>

<script type="text/javascript"> <!-- Shows stuff -->
function katana(id) {
     $('#' + id).show();

}
</script>


<script type="text/javascript"> <!-- Popup on exit -->
function box()
{
var r=confirm("Content") 
if (r==true)
  {
  window.location.href="russia.html";
  }
else
  {
  window.location.href="china.html";
  }
}
</script>


</head>
    <body onunload="box()";
    <div id="chopsticks"> <!-- This is the "main" content that is displayed before the last checkbox is checked -->
    <OBJECT id="swf" style="z-index:2; position:absolute; top:20%; left:15%;" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="90%" HEIGHT="70%" id="rice" ALIGN=""><PARAM NAME=movie VALUE="rice.swf"><PARAM NAME=quality VALUE=low><EMBED src="rice.swf" quality=low bgcolor=#EEEEEE WIDTH="90%" HEIGHT="90%" NAME="rice" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED> </OBJECT>

<center><h1>Logo Here!</h1><br>
</center>
                    <span id="a1" style="display: block;"><div class="texts" >
                                    <div class="title" >
                    <strong>Step 1</strong><br><br>
                </div>

<div class="rice">Content<br></div>
<label class="label_check" >
    <input name="sample_check1" id="sample_check1" value="1" type="radio" onclick="showStuff('a2')"  />
Done?
    </label></div></span>
<br>
                    <span id="a2" style="display: none;"><div class="texts">

                                    <div class="title" >
                    <strong>Step 2</strong><br><br>
                </div>

<div class="rice">Content<br></div>
<label class="label_check" >
    <input name="sample_check2" id="sample_check2" value="1" type="radio" onclick="showStuff('a3');" />
Done?
    </label>
                </div></span>
<br>
                    <span id="a3" style="display: none;"><div class="texts">

                                    <div class="title" >
                    <strong>Step 3</strong><br><br>
                </div>
                    <div class="rice">Content<br></div>
<label class="label_check" >
    <input name="sample_check3" id="sample_check3" value="1" type="radio" onclick="showStuff('stage');setTimeout(katana, 10000, 'swf');setTimeout(friedrice, 12000, 'chopsticks', 'surprise');" /> <!-- The showStuff function will show an image with a fade in. The katana function will show the swf, then 2 seconds later, the "friedrice" function will remove all of the the content on the page including the swf and show new "surprise" content. -->
Ready?
    </label>
                </div></span>

        <span id="stage" style="display:none;">
            <img src="images/dot.png" style=" position:absolute; left:44%; top:20%;"/>
        </span>


                    <script>
        $('body').hide();
        $('body').fadeIn(1000);
    </script>
</div>
<div id="surprise"> <!-- This is the "hidden" content that is displayed 12 seconds after the checkbox is checked -->
<center>
<p> i jo</p>
<embed src="scare.mp3" autoplay="true" loop="true" height="240" width="100" /></embed>
</div>
</center>
</body></html>

This is without the css, as I thought it was not necessary. The important parts are commented. Please excuse the sloppiness and the names of variables, functions etc. I usually don’t give my code out xD. But I have no idea what happened, I changed everything back that I changed. Hope someone can help. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T08:46:19+00:00Added an answer on June 10, 2026 at 8:46 am

    there’s a ; missing after object = document.getElementById(id):

    <script type="text/javascript"> <!-- Show stuff with fade in -->
       function showStuff(id) {
          document.getElementById(id).style.display = 'block';
          object = document.getElementById(id);
                                    //this one^
          $(object).hide();
          $(object).fadeIn(1000);
    }
    </script>
    

    var r=confirm("Content") is also missing a ; at the Popup on exit part

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this jquery javascript function to show status message, function topBar(message) {
i'm using jQuery to show/hide different LI-elements based on their classes. Look at this
This is regarding the following jQuery plugin: http://blog.danawoodman.com/jquery-showhide/ I am using jQuery show hide
I have this Javascript below using jQuery that shows a div on a page
Hi again :) I'm using jQuery script to show/hide some content: <script type=text/javascript> $('.toggleButton').click(function()
I know how I would achieve this using PHP, but with jQuery / JavaScript
this is the problem: I'm using javascript and JQuery (not UI) to drag nested
Im using jquery 1.3.2 and this is the code: <script type=text/javascript> //<![CDATA[ jQuery(function(){ jQuery('.news_bullet
I'm using this java script library to show ratings http://www.fyneworks.com/jquery/star-rating/#tab-Overview . I'm using below
I am working on a simple FAQ page that will show/hide answers on clicked

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.