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 8714943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:43:39+00:00 2026-06-13T05:43:39+00:00

First time making a Javascript script from scratch. This works perfectly in Firefox, but

  • 0

First time making a Javascript script from scratch. This works perfectly in Firefox, but when viewed in Chrome or Safari the right sidebar doesn’t change opacity at all. This was designed so that when the mouse hovers over the sidebar div, it changes the opacity of the arrow img within that div. The left sidebar is set to be the same, but changes opacity of the div and img.

I designed it this way as the client wanted to see what both look like before coming to a decision which one to keep. Once that decision is made it will just be one or the other, so I need to get the right sidebar fixed up!

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Giterman Designs</title>     
<link rel="stylesheet" type="text/css" href="style.css"> 


<script type="text/javascript">
function changeOpacity(elm, value) {
   elm.style.opacity = (value / 100);
   elm.style.MozOpacity = (value / 100);
   elm.style.KhtmlOpacity = (value / 100);
   elm.style.filter = "alpha(opacity=" + (value) + ")";
   elm.style.MsFilter = " 'progid:DXImageTransform.Microsoft.Alpha(opacity=" + (value) + ")' ";}
</script>

</head> 
<body>

<!-- Left Side: Hover over Div, Div+Image shifts opacity -->
<div id="leftNav" class="sidebar" onMouseOver="changeOpacity(this, 70)" onMouseOut="changeOpacity(this, 20)">
    <img src="image/leftNav.png" id="leftButton" class="arrow" alt=""></div>

<!-- Right Side: Hover over Div, Image shifts opacity -->       
<div id="rightNav" class="sidebar2" onMouseOver="changeOpacity(rightButton, 70)" onMouseOut="changeOpacity(rightButton, 20)">
    <img src="image/rightNav.png" id="rightButton" class="arrow" alt=""></div>
</body>
</html>

and the CSS

body{
background: url("image/bg.jpg") no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;}

div#leftNav{
position:absolute; left:0;}

div#rightNav{
position:absolute; right:0;}

/* Left Side-bar */
.sidebar{
background:#000000; width: 55px; height: 100%; top:0; opacity:0.20;}

/* Right Side-bar */
.sidebar2{
background: url("image/bar.png") repeat-y; width: 55px; height: 100%; top:0;}

/* Needed to seperate arrow opacity for Right Side-bar attempt */
#rightButton{
opacity: 0.20;}

img.arrow{
position: absolute; top: 50%; left: 50%; margin: 0 0 0 -35%;} 
  • 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-13T05:43:40+00:00Added an answer on June 13, 2026 at 5:43 am

    You code for left:

    onMouseOver="changeOpacity(this, 70)" 
    

    but for right you are not using this:

    onMouseOver="changeOpacity(rightButton, 70)"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first time making a hash table. I'm trying to associate strings
This Javascript which uses functions from jQuery is quite handy but getting feedback on
I'm making calls from managed code to javascript, and would like to display time
I am making static library for the first time and I need to input
first time posting here. I'm using a loop to create 3 buttons, but my
Hey, I've just started learning JavaScript and I'm making a little script that generates
I have several javascript files that during run-time get combined and minified. This is
I'm making my own javascript-based programming language (yeah, it is crazy, but it's for
I'm not sure this is possible, but I'm interesting in making this happen. Ideally,
Hi I'm making an android app for the first time and I am stuck

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.