JQuery :: Rollover Getting Li BackgroundPosition
Sep 1, 2009
How do I return a lists background-image's backgroundPosition?
I am trying to achieve a navigation menu whereby, when the li element is rolled over a grey square moves under the li element.
Here is what I have done so far:
So when the li element is rolled over I want to be able to identify said li backgroundPosition and use that value to move the ul's background image.
I realise that this could be done simply by giving each li element a different class name then giving it a mouseover function, but this is for a dynamic Wordpress nav bar so each li element does not have a unique class name.
View 1 Replies
ADVERTISEMENT
Jan 4, 2011
I recently got very interested in jQuery and found my way into it but I'm now facing this problem where I can't animate the position of a background image in IE. I've tested it in Google Chrome, FireFox, Safari, Opera and Internet Explorer. It works in the first 4 browsers but not in IE and that is a pretty big problem since a lot of people are (still ) using IE, I think.
Here is the animation:
As I mentioned, it works in every major browser except for Internet Explorer.
View 1 Replies
View Related
Nov 24, 2010
I need help with an IE8 problem. I want to give as many facts as possible.
Reference: [url]
I have already banned less than IE8 from my site but have the following problem with IE8 only (works on Mac and Win in these"allowed" browsers:Safari 5+, Chrome, FF 3.5+ and Opera 10+):
I use the backgroundPosition setter / getter extensively in this animation-extensive site.
But it breaks in IE8.
I did hack this as the only way I could get IE8 to work in a frame animation algorithm, noting that I have to test for browser and version (ugh) and then use this getter:
The following is an example that appears to work but seems unstable to me: (note that "accordionState"references an object within a data store attached to the "page" element):
There are many other cases where I have get or setbackgroundPosition,especially in the 'over' and out' functions where I use hoverIntent.
As a great fan and user of jQuery, I am puzzled that this will not work in IE8. Note thatbackgroundColor does not work either, although I do use UI to do these sorts of things and it seems to work in IE.
View 1 Replies
View Related
Sep 23, 2009
Some issues with jquery animate. im trying to create a navigation menu that apon mouseover, the background image animates with a negative y value. apon mouseout, the div will animate the background position back to zero. Simple enough ay? thats what i thought. When i roll over the divs with the bg image, they do not animate, it appears like a simple background change. in other words, there is no tween or movement, just ...new position.
INCLUDES
JQUERY
CSS
HTML
As i said, the animate property will not MOTION or TWEEn in the YAXIS, it will however as i tried animate in the XAXIS. got me stumped and at deadlock.
View 6 Replies
View Related
Oct 1, 2009
$(function(){
Why this is not working...?
View 1 Replies
View Related
Sep 24, 2009
Having some trouble with this plugin. I've tried in both IE8 and FF3, but it doesn't seem to work. Basically the background position isn't moving...the function toArray(strg) is suppose to return the following....return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]]; this is the line where I'm getting an error code.
The values res[2] and res[4] are coming back as NaN. I'm not sure what these values represent, or why they are Null.
I'm calling the backgroundPosition like this:
My css reads:
View 1 Replies
View Related
Aug 28, 2007
I have a menu done in CSS. When you mouse over the menu i change the background position in order to display the 'hover' state. I'm using javascript to show/hide <div> when you click on a button to display proper content without reloading the page (Like a tab menu).
To display the menu in a 'hover' state when you have clicked, i use also javascript to move the background position so it stays on the hover state. But when i mouse over my other menu, they do not apply the CSS anymore.
Here is the JS i use on a 'onclick':
function menu()
{
document.getElementById('menu2').style.backgroundPosition = 'center 0'
document.getElementById('menu1').style.backgroundPosition = 'center -48px'
}
I guess it have something to do with the fact that i alter the CSS with the JS. But anyone know how to fix this without having to create my mouseover with JS and keep it in CSS?
View 3 Replies
View Related
Jun 5, 2010
I have navigation buttons that I'll call primary buttons. I also have secondary navigation buttons that I'll call secondary buttons. If you rollover a primary navigation button, it should make secondary navigation buttons 1,4,and 5 go to rollover state A. However, if you rollover secondary navigation button 1,4 or 5 they should go to rollover state B.So the simplest way I can explain it is that the secondary navigation buttons need two rollover states possible.
View 2 Replies
View Related
May 11, 2010
Before, I had an iframe, and when I moused over a link outside the iframe, it would load a page into the iframe. Background image was part of the page loaded, as well as the text and what not. The problem was, the image took too long to load. I've been learning how to do javascript and I came across some code for preloading an image before the mouseover so there was zero wait time. For the past few days I've been trying to figure out how to have the preload image appear BENEATH the iframe (now with no background image or color) with the allowtransparency attribute set to true.
I've figured out the code to do both individually, i.e. I have the code so that when the link is moused over, the new image will appear; AND I have the code so that when the link is moused over, the page with load into the iframe. Both work, both do what is expected, but they don't do it together.Below is the script. Here's where it's confusing. If I have the "setupImgRollover..." first inside the if statement: the page loads into the iframe, but there is no image. If I have the "setupImgRollover..." after the "document.link..." commands in the if statement: the image appears but the page does not load into the iframe.
HTML Code:
window.onload = rolloverInit;
function rolloverInit() {
for (var i=0; i<document.links.length; i++) {
var linkObj = document.links[i];
[code]....
View 2 Replies
View Related
Jun 3, 2011
I have a simple jquery function that uses slideToggle() to show the child nested UL of a parent LI tag. It works fine, and it's positioned to slide down to the right of the list item. However, when I roll over a list item on the right side of the screen, I would like the rollover to show up to the left of the item, and when you're at the bottom of the page, It should slide up into the available window space.
View 1 Replies
View Related
Feb 2, 2010
I want to have a world map where you can hover over icons on a few countries and a popup text box will show where that place is.
View 4 Replies
View Related
Jul 22, 2009
I have a test blog I am working on at:
[URL]
I am trying to add some jquery image rollovers like the type featured on ThemeForest:
[URL]
I got the image rollovers to work, however I want to add links to them. Each time I add an href tag around the images, the script stops working.
View 2 Replies
View Related
Oct 3, 2010
All I needs is for one div to have an animated height when another div is rolled over.Example:
<div class="button"></div>
<div class="animatedBox"></div>
So basically, I want the "animatedBox" div to have an animated expansion in height when the "button" div is rolled over. When the "button" div is rolled out, I would for the "animatedBox" div to go back to the original height. Let's go ahead and say the original height is 20px and when the "button" div is rolled over, the height changes to 50px.
View 14 Replies
View Related
Sep 19, 2010
I have an advert banner in the header of my web page. When the end-user rolls over it I want it to expand/drop-down to display further information about the advert. This is commonplace in rich-media adverts but I can't find any tutorials or resources to get me started[URL] Here's an image of what I'm trying to achieve:
View 3 Replies
View Related
Aug 7, 2009
I am trying to implement a cool effect seen here: [URL] in the sidebar and detailled here: [URL]... ith-jquery with little success...
I have included the easing and color js files as well as jquery (present in the theme anyway).
The code I'm using is:
jQuery(document).ready(function(){
jQuery.easing.def = "easeInOutSine";
jQuery('#sidebar .widget ul li').bind('mouseenter',function(){
jQuery(this).stop().animate({
[Code].....
The line which I believe is causing problems is:
jQuery('#sidebar .widget ul li').bind('mouseenter',function(){
I have tried different variation of the element, e.g.
jQuery('#sidebar .widget > ul > li').bind('mouseenter',function(){
but simply don't know what this needs to be (or the relevance of using '>')
Thinking there may have been a conflict in the code, I disabled all other JS - this didn't help.
The site is [URL] (look for the categories in the sidebar).
View 12 Replies
View Related
Apr 13, 2010
I wrote a couple of lines of code to simply fade in an image when a user rolls over a link:
[URL]
The only problem (which you probably already noticed) is that when you rollover the links quickly, the image appears below the other for a quick second until it completely fades away. I want each image to appear on top of each other when the user rolls over a link fairly fast, so it doesn't change the shape of the website like that. In other words it will look like they crossfade pretty much.
View 1 Replies
View Related
May 18, 2009
I can't seem to figure out how to properly change my dropdown menu to work on rollover instead of on Click. When I change this to .hover I get a yo yo effect
sample:
http://www.creativemagma.com/whitney
<script type="text/javascript" src="scripts/js.js"></script>
[code]...
View 1 Replies
View Related
Aug 5, 2010
I have some simple rollover code here where I take the rel of an anchor and show the corresponding html ID.
I would like to set the location of the appearance of the tooltip using jquery. So, basically I want to secure the mouse location and append it to the CSS.
How do I do this?
View 2 Replies
View Related
Aug 5, 2011
I have two images, one on top of another. I would like it so that if you mouse over the image on top (imgB), this image would resize and expand. I have tried playing with jQuery's animate() and height/width properties, but these just crop the image as oppose to resizing them.
<div id="imgA" style="background-image:url(aq.jpg); width:1000px; height:400px;">
<div id="imgB" style="background-image:url(wmc.png); width:200px; height:200px;"></div>
</div>
[code]....
View 1 Replies
View Related
Jul 31, 2009
I have been trying to find an answer to this question. I am trying to create a nav bar using jquery that uses images and rollovers. So there is an on state, off state and clicked state for three different tabs/images.
example: Home | Support | About
The problem I¢m having is getting the clicked/on state to turn off the other image/tab if it was already on/clicked state. What keeps happening is each tab stays active when clicked instead of toggling off and on.
[Code]...
View 2 Replies
View Related
Dec 12, 2010
on my website: [URL] I am using the buttons from JQuery UI, as you can see on the example: [URL] there is a rollover effect on the button but not on my website?!
View 4 Replies
View Related
Feb 12, 2010
I have a jquery rollover which basically changes the rollover image when a menu option is rolled over. I've been told that it does not work properly in IE6 causing all of the images to show at once
View 1 Replies
View Related
Jul 13, 2010
On the right side, under the portrait of the two girls, you will see a list of four links next to some dates. onMouseOver, the photograph of the girls should change. This works fine in IE, Firefox, Safari and Opera. In Chrome, however, it seems (using Chrome Developer Tools) that Chrome load the images each time, instead of preloading, and displaying the cached image each time i onMouseOver.
View 1 Replies
View Related
Sep 1, 2010
I've been researching a good effective way to do 3 state image rollovers with jQuery, but haven't found anything that's workable with an AJAX style page. The page consists of a ul based menu that shows and hides new content depending on the selection. What I'm attempting to achieve is once the image has been clicked on, for the "over" state to remain until a new choice is made from that menu, aka another image has been clicked on. Once another image was clicked on, it would then display the active state and the previous would not.
Here is the HTML:
<ul id="navWork">
<li onclick="javascript:doShowHide('spotsPromos');">
<a href="javascript://">
<img src="images/nav-spots-promos.png" alt="Spots and Promos" />
</a>
</li>
<li onclick="javascript:doShowHide('corporate');">
<a href="javascript://">
<img src="images/nav-corporate.png" alt="Corporate" />
</a>
</li>
</ul>
Here is the JavaScript that is activating the rollovers:
$(document).ready(function() {
// preload all rollovers
$("#navWork img").each(function() {
// Set the original src
rollsrc = $(this).attr("src");
rollON = rollsrc.replace(/.png$/ig,"-over.png");
$("<img>").attr("src", rollON);
});
// navigation rollovers
$("#navWork a").mouseover(function(){
imgsrc = $(this).children("img").attr("src");
matches = imgsrc.match(/-over/);
// fon't do the rollover if state is already ON
if (!matches) {
imgsrcON = imgsrc.replace(/.png$/ig,"-over.png"); // strip off extension
$(this).children("img").attr("src", imgsrcON);
}});
$("#navWork a").mouseout(function(){
$(this).children("img").attr("src", imgsrc);
});});
View 1 Replies
View Related
Jun 8, 2010
I have a page displaying a portfolio of logos, print pubs, websites, etc. When the page originally loads, all items are included in the slideshow. I would like only logo images displaying when the user places the mouse on the logos link.
Example here: [URL]
The jQuery call below works (i.e. the range of the images is limited to only those with class logos) if the menu link to "logos" gets a mouseenter event while the slideshow is showing one of the logo images (class="logos"). However, if the slideshow has progressed to one of the other sections (class="print", web, sign, etc) then the slideshow will not resume.
Below is the jQuery call when a user places their cursor on the logos menu link.
$("a.logos").mouseenter(
function () {
$('.slideshow').cycle('stop').cycle({ slideExpr: 'img.logos' });
$('.slideshow').cycle('resume');
[Code].....
View 1 Replies
View Related
May 21, 2009
if there's some effect in JQ that we can use to simulate rollover. Usually when user hovers a mouse over a link/image it changes its src/ background to another one (for example arrow.png -> arrow_o.png). So users feels like it is highlighted or similar. But we always must have 2 images (similar ones). Maybe there's some effect that can simulate this highligting/hover for user so we don't need to have 2 images. I understand it will never be as good as alternative image, but still.
View 12 Replies
View Related