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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:35:36+00:00 2026-06-16T01:35:36+00:00

<a href=# onMouseOver=document.getElementById(‘button1Inline’).style.backgroundPosition=’0px -90px’;> <img src=ads/button1.png id=button1Inline /> </a> The button1.png is a 180

  • 0
<a href="#" onMouseOver="document.getElementById('button1Inline').style.backgroundPosition='0px -90px';">
    <img src="ads/button1.png" id="button1Inline" />
</a>

The button1.png is a 180 pixels tall sprite comprised of two effect halves. Due to unnatural forces beyond my control I have to make this work inline. I know it’s not best practice and I feel terrible about myself, but right now I just need it to work. Please and 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-16T01:35:38+00:00Added an answer on June 16, 2026 at 1:35 am

    One way to do that could be having a HTML like this:

    <a href="#" id="button1"></a>
    

    And you could give it CSS properties like display: block; or display: inline-block; with the width of your image and half the height of it and then a :hover style.

    For example:

    #button1 {
        display: block;
        width: 180px; /* assuming it's square */
        height: 90px;
        background: url(<path_to_images>/button1.png) top left no-repeat transparent;
        background-position: 0 0;
    }
    #button1:hover {
        background-position: 0 -90px;
    }
    

    That way you don’t need any Javascript and have no side-effects.

    Remember background-position just works for HTML elements that have a background-image set.

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

Sidebar

Related Questions

Using the following code: <a href=/someurl> <div class='mydiv' onMouseOver=document.getElementById('myid').sendEvent('play'); onMouseOut=document.getElementById('myid').sendEvent('stop');> <div id='myid'></div> <script type=text/javascript>
I use this simple script : <body> <script type=text/javascript> function mouseOver() { document.getElementById(img1).src =images/p2.jpg;
<div class="menu_item_variant" id="date" onmouseover="mouseIn(this.id)" onmouseout="mouseOut(this.id)"> <a href="dating-advice.html">Dating Coaching &amp; Advice</a> </div> hi, could some
In testing document.location.href, I have observed that when the user initiates an action that
I have an href image in this markup. <div class=imgdiv> <a class=imga href=http://destination.com> <img
I have this code: function Imagehover(obj,img){ jQuery(#+obj.id).attr(src,<?php echo $this->baseurl ?>/templates/codecraft.gr/images/+img+.png); } function Imageclick(obj,img){ jQuery(#+obj.id).attr(src,<?php
i set anchor tag in masterpage as <a onmouseout=mclosetime() onmouseover=mopen('m2') id=AnchorText5 href=#>TEst</a> but when
location.href location.replace document.URL As seen from other similar questions, can we consolidate all such
def download_if_dne(href, filename): if os.path.isfile(filename): # print 'already downloaded:', href return False else: if
Our site contains href links to various subdomains: foo.mysite.com, bar.mysite.com. For testing purposes, I'd

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.