jquery-animate

Preload iframe

£可爱£侵袭症+ 提交于 2019-12-01 07:36:34
function toggle(){ $("#tempc").toggle( function () { $("#tempc").animate({width: 255, height: 220}, 1000); $("#tempc").html(""); $("#tempc").css("background-color", "transparent"); $("#tempc").html("<iframe src='/src/stream.php?stream=1' width='255' height='225' frameborder='0' scrolling='no'></iframe><br><a href='javascript:;' onclick='hidegadget();' class='yellowblock'>Sluit</a>"); }, function () { $("#tempc").animate({width: 50, height:50}, 1000); $("#tempc").html(""); $("#tempc").css("background-color", "#FFFF00"); $.get('src/stream.php?stream=2', function(data002) { $('#tempc').html

jQuery animate()

允我心安 提交于 2019-12-01 07:35:30
My code is as given below : <!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=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- #Layer1 { position:absolute; width:200px; height:115px; z-index:1; left: 445px; top: 64px; } --> </style> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> <script type="text/javascript"> function toggle() { $("#Layer1")

Moving elements with javascript

狂风中的少年 提交于 2019-12-01 07:13:56
问题 What are the best practices for moving elements with javascript? Do you use timeouts or intervals? Is it bad to have timed events for 10 milliseconds, or will it be precise? Do you move pixel by pixel, or a certain fraction of the total distance? If you use intervals, how do you stop the interval when the element is in position? The last two times I've seen motion in javascript have been with jQuery and Raphael.js, neither of which I can understand the source code of. Are there some good

Using jQuery to change div width from 50% to 70% on hover

我的梦境 提交于 2019-12-01 07:09:04
I have two divs that have 50% width each. I want to make it so that the the hovered div expands to 70% and the other reduces to 30%. And when the mouse moves out, they both return to 50% each. I wrote a script but it doesn't give the right results. The widths are fluid so they need to adjust to all window sizes. how Can I make this work right? I didn't write the mouseout function yet as the mouseover doesn't function correctly. Here's how it works now: http://jsfiddle.net/kYZyp/ Here's my code: <div id="left" class="content_left"></div> <div id="right" class="content_right"></div> Here's my

Jquery background animate

試著忘記壹切 提交于 2019-12-01 06:35:58
Is it possible to animate the background-color in jQuery, because it is not working. $('#something').animate({ background :"red" }, 1000); From the docs , The jQuery UI project extends the .animate() method by allowing some non-numeric styles such as colors to be animated. The project also includes mechanisms for specifying animations through CSS classes rather than individual attributes. So if you use jQuery UI, you can animate background colors. Just make sure that you use backgroundColor and not background . The color animations plugin for jQuery also does it. Live Example: http://jsfiddle

How to continuously rotate children in a jQuery animation?

本小妞迷上赌 提交于 2019-12-01 06:32:31
I have a div with class 'bannergroup' that contains multiple divs 'banneritem'. I want these items to rotate (fade in then fade out) in place of each other. I can have several divs with the class bannergroup and each one should rotate separately. Here is the HTML: <div class="bannergroup"> <div class="banneritem">Only visible one at a time</div> <div class="banneritem">Only visible one at a time</div> <div class="banneritem">Only visible one at a time</div> <div class="banneritem">Only visible one at a time</div> </div> <div class="bannergroup"> <div class="banneritem">Only visible one at a

JQuery: Children Disappear on Parent Size Animation

跟風遠走 提交于 2019-12-01 05:56:37
In this simplified version of a hierarchical diagram, child elements disappear when their parent's size is animated. Is there any way to prevent this? <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <style type="text/css"> div { position:absolute; width:40px; height: 40px; background: #f00; } </style> </head> <body> <script language="javascript"> $(document).ready(function (e) { $('div').hover(function (e) { e.stopPropagation(); $(e.target).animate({ width: "100px", height: "100px" }, 400).children('p').fadeIn(1000);

Jquery background animate

时光总嘲笑我的痴心妄想 提交于 2019-12-01 05:27:24
问题 Is it possible to animate the background-color in jQuery, because it is not working. $('#something').animate({ background :"red" }, 1000); 回答1: From the docs, The jQuery UI project extends the .animate() method by allowing some non-numeric styles such as colors to be animated. The project also includes mechanisms for specifying animations through CSS classes rather than individual attributes. So if you use jQuery UI, you can animate background colors. Just make sure that you use

jQuery animate()

核能气质少年 提交于 2019-12-01 05:20:20
问题 My code is as given below : <!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=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- #Layer1 { position:absolute; width:200px; height:115px; z-index:1; left: 445px; top: 64px; } --> </style> <script type="text/javascript" src="http://code

Preload iframe

落花浮王杯 提交于 2019-12-01 04:47:07
问题 function toggle(){ $("#tempc").toggle( function () { $("#tempc").animate({width: 255, height: 220}, 1000); $("#tempc").html(""); $("#tempc").css("background-color", "transparent"); $("#tempc").html("<iframe src='/src/stream.php?stream=1' width='255' height='225' frameborder='0' scrolling='no'></iframe><br><a href='javascript:;' onclick='hidegadget();' class='yellowblock'>Sluit</a>"); }, function () { $("#tempc").animate({width: 50, height:50}, 1000); $("#tempc").html(""); $("#tempc").css(