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

  • Home
  • SEARCH
  • 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 5965451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:37:54+00:00 2026-05-22T19:37:54+00:00

I’m trying to use the EXACT SAME jQuery code. It works in one html

  • 0

I’m trying to use the EXACT SAME jQuery code. It works in one html document but not in the second. I’m using CSS in these documents as well. Both the CSS and the jQuery code are not in external files. I feel like the solution is probably something simple so forgive me for my lack of knowledge. I will leave the jQuery code, the CSS code, the html code that isn’t functioning with the jQuery and exactly how it looks in the document(all in one). I will list them in that exact order.

JQUERY CODE:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $(".showr").click(function(){
    $(".vidr").css('visibility','visible');
    $(".vids").css('visibility','hidden');
  });
  $(".shows").click(function(){
    $(".vidr").css('visibility','hidden');
    $(".vids").css('visibility','visible');
  });
    $(".left").click(function(){  
    $(".showr").animate({"left":"-=110px"},"slow");
    $(".shows").animate({"left":"-=110px"},"slow");
  });
    $(".right").click(function(){  
    $(".showr").animate({"left":"+=110px"},"slow");
    $(".shows").animate({"left":"+=110px"},"slow");
  });
});
</script>

CSS CODE:

<style type="text/css">
html,body
{
padding:0;
margin:0;
height:1200px;
overflow-y:scroll;
}
body
{
overflow-x:hidden;
overflow-y:hidden;
}
.stretch
{
width:100%;
height:1200px;
position:relative;
z-index:-2;
}
.topmenu
{
position:relative;
top:-2400px;
left:100px;
z-index:-1;
}
.videoplayer
{
position:relative;
top:-3600px;
left:100px;
z-index:-1;
}
.videoscroller
{
position:relative;
top:-4800px;
left:100px;
z-index:-1;
}
.twitterfeed
{
position:relative;
top:-8755px;
left:100px;
z-index:-1;
}
.slider
{
position:relative;
left:263px;
bottom:3050px;
z-index:0;
overflow:hidden;
width:485px;
height:160px;
margin:0px; 
padding:5px;
background:#e5eecc;
border:solid 1px #c3c3c3;
}
div.left
{
position:relative;
left:208px;
bottom:3175px;
z-index:0;
overflow:hidden;
width:42px;
height:80px;
margin:0px; 
padding:5px;
background:black;
border:solid 1px #c3c3c3;
}
div.right
{
position:relative;
left:761px;
bottom:3272px;
z-index:0;
overflow:hidden;
width:42px;
height:80px;
margin:0px; 
padding:5px;
background:white;
border:solid 1px #c3c3c3;
}
div.videos
{
position:absolute;
left:210px;
top:138px;
z-index:1;
width:592px;
height:383px;
margin:0px; 
padding:5px;
}
iframe
{
position:absolute;
left:20px;
top:20px;
}
img.showr
{
position:absolute;
z-index:2;
}
img.shows
{
position:absolute;
left:180px;
z-index:2;
}

</style>

HTML CODE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
</head>

<body>
<div><img src="Background2IBSTV.jpg" class="stretch"/>
</div>
<div style="position:relative; top:-1200px; left:100px;" class="stretch"><img src="railsIBSTV.png"/>
</div>
<div class="topmenu"><img src="Top_MenuIBSTV.png"/>
</div>
<div class="videoplayer"><img src="video_playerIBSTV.png"/>
<div class="videos">
<iframe class="vidr" style="visibility:hidden;" width="560" height="349" src="http://www.youtube.com/embed/nwYYaqs_yM4" frameborder="0" allowfullscreen></iframe>
<iframe class="vids" style="visibility:hidden;" width="560" height="349" src="http://www.youtube.com/embed/fO4aXYETHxE" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<div class="videoscroller"><img src="video_scrollerIBSTV.png"/>
<img src="left_arrowIBSTV.png" style="position:relative; left:-22px; bottom:1200px;"/>
<img src="right_arrowIBSTV.png" style="position:relative; left:22px; bottom:2400px;"/>
<div class="slider">
<img src="rampage-jackson.jpg" class="showr" width="165" height="150">
<img src="Professional.jpg" class="shows" width="165" height="150">
</div>
<div class="left"></div>
<div class="right"></div>
</div>
<div class="twitterfeed"><img src="twitter_feedIBSTV.png"/><p style="position:relative; left:455px; bottom:450px; font-size:35px; color:lightgrey;">Twitter</p>
</div>
</body>
</html>

ALL IN ONE (Exactly how it looks in document)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $(".showr").click(function(){
    $(".vidr").css('visibility','visible');
    $(".vids").css('visibility','hidden');
  });
  $(".shows").click(function(){
    $(".vidr").css('visibility','hidden');
    $(".vids").css('visibility','visible');
  });
    $(".left").click(function(){  
    $(".showr").animate({"left":"-=110px"},"slow");
    $(".shows").animate({"left":"-=110px"},"slow");
  });
    $(".right").click(function(){  
    $(".showr").animate({"left":"+=110px"},"slow");
    $(".shows").animate({"left":"+=110px"},"slow");
  });
});
</script>
<style type="text/css">
html,body
{
padding:0;
margin:0;
height:1200px;
overflow-y:scroll;
}
body
{
overflow-x:hidden;
overflow-y:hidden;
}
.stretch
{
width:100%;
height:1200px;
position:relative;
z-index:-2;
}
.topmenu
{
position:relative;
top:-2400px;
left:100px;
z-index:-1;
}
.videoplayer
{
position:relative;
top:-3600px;
left:100px;
z-index:-1;
}
.videoscroller
{
position:relative;
top:-4800px;
left:100px;
z-index:-1;
}
.twitterfeed
{
position:relative;
top:-8755px;
left:100px;
z-index:-1;
}
.slider
{
position:relative;
left:263px;
bottom:3050px;
z-index:0;
overflow:hidden;
width:485px;
height:160px;
margin:0px; 
padding:5px;
background:#e5eecc;
border:solid 1px #c3c3c3;
}
div.left
{
position:relative;
left:208px;
bottom:3175px;
z-index:0;
overflow:hidden;
width:42px;
height:80px;
margin:0px; 
padding:5px;
background:black;
border:solid 1px #c3c3c3;
}
div.right
{
position:relative;
left:761px;
bottom:3272px;
z-index:0;
overflow:hidden;
width:42px;
height:80px;
margin:0px; 
padding:5px;
background:white;
border:solid 1px #c3c3c3;
}
div.videos
{
position:absolute;
left:210px;
top:138px;
z-index:1;
width:592px;
height:383px;
margin:0px; 
padding:5px;
}
iframe
{
position:absolute;
left:20px;
top:20px;
}
img.showr
{
position:absolute;
z-index:2;
}
img.shows
{
position:absolute;
left:180px;
z-index:2;
}

</style>
</head>

<body>
<div><img src="Background2IBSTV.jpg" class="stretch"/>
</div>
<div style="position:relative; top:-1200px; left:100px;" class="stretch"><img src="railsIBSTV.png"/>
</div>
<div class="topmenu"><img src="Top_MenuIBSTV.png"/>
</div>
<div class="videoplayer"><img src="video_playerIBSTV.png"/>
<div class="videos">
<iframe class="vidr" style="visibility:hidden;" width="560" height="349" src="http://www.youtube.com/embed/nwYYaqs_yM4" frameborder="0" allowfullscreen></iframe>
<iframe class="vids" style="visibility:hidden;" width="560" height="349" src="http://www.youtube.com/embed/fO4aXYETHxE" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<div class="videoscroller"><img src="video_scrollerIBSTV.png"/>
<img src="left_arrowIBSTV.png" style="position:relative; left:-22px; bottom:1200px;"/>
<img src="right_arrowIBSTV.png" style="position:relative; left:22px; bottom:2400px;"/>
<div class="slider">
<img src="rampage-jackson.jpg" class="showr" width="165" height="150">
<img src="Professional.jpg" class="shows" width="165" height="150">
</div>
<div class="left"></div>
<div class="right"></div>
</div>
<div class="twitterfeed"><img src="twitter_feedIBSTV.png"/><p style="position:relative; left:455px; bottom:450px; font-size:35px; color:lightgrey;">Twitter</p>
</div>
</body>
</html>
  • 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-05-22T19:37:55+00:00Added an answer on May 22, 2026 at 7:37 pm

    I think that the problem is with the version of jquery and/or clashes between inline styles and stylesheet styles.

    I set up a jsfiddle and if you run your HTML and jquery nothing happens on jquery 1.2.6 but the code works OK on jquery versions 1.3.2, 1.4.4, 1.5.2, 1.6.

    I didn’t include the css in the fiddle because you have inline styles as well as using a stylesheet – the clashes between the two break the page on js fiddle, so I guess there are conflicts causing unwanted side-effects.

    I would switch to using helper methods rather than directly referencing CSS styles; so use:

    $(".vidr").hide();
    

    rather than:

    $(".vidr").css('visibility','hidden');
    

    And you might want to look at the jquery animate function because I’m not sure whether your use of it is achieving what it is you want it to.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm making a simple page using Google Maps API 3. My first. One marker
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have thousands of HTML files to process using Groovy/Java and I need to
Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.