Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-27-2013, 11:31 AM   PM User | #1
jarv
Banned

 
Join Date: Mar 2007
Posts: 1,523
Thanks: 116
Thanked 0 Times in 0 Posts
jarv can only hope to improve
Jquery animate - Type error: * is not a function

Please help, I am trying to apply a slide up animation on a background image but I am not sure I am writing my code correctly.

Firstly, I am getting a type error: * is not a function

secondly, I think I need to add CSS styling property to background-position: -182px and not just bottom: '-182'

Code:
<script type="text/javascript">
	  $(document).ready(function() {
		// on mouse over
		$("ul#sections li#who").hover(function () {
			// animate opacity to full
			$(this).stop().animate({
				bottom: '-182'
			}, 'slow');
		},
		// on mouse out
		function () {
			// animate opacity to nill
			$(this).stop().animate({
				top: 0
			}, 'slow');
		});
	});
</script>
jarv is offline   Reply With Quote
Old 02-27-2013, 11:49 AM   PM User | #2
jarv
Banned

 
Join Date: Mar 2007
Posts: 1,523
Thanks: 116
Thanked 0 Times in 0 Posts
jarv can only hope to improve
ok, I just changed code to this:

Code:
<script type="text/javascript">
$('ul#sections li#who').css({
    backgroundPosition: "0% 0%"
}).hover(
    function() {
        $(this).stop().animate({
            'background-position-x': "50%"
        }, "600");
    }, function() {
        $(this).stop().animate({
            'background-position-x': "0%"
        }, "600");
    }
);
</script>
still nothing
jarv is offline   Reply With Quote
Old 02-27-2013, 12:24 PM   PM User | #3
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
Let me guess ... you are testing in Firefox? Sadly, Mozilla has removed the support for background-position-x and background-position-y as of FF3 claiming that they were not part of specification. So it just won't work in Firefox any more. If you test in Chrome for example, it should work, though.

I haven't come across a working version of .animate() for background-position yet.
devnull69 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:02 PM.


Advertisement
Log in to turn off these ads.