2013-05-31 34 views
-3

我正在创建一个网页,我需要以这样的方式滑动文本和图像:图像从左侧滑动,然后文本从右侧滑动按钮通过使用jQuery/JavaScript。如何从左到右滑动文字和图像滑动效果

请检查该slider我希望我的文字和图像,以这样的

滑动请建议我用必要的JS/JQuery的

+0

请查看我所提供 – Thejdeep

+2

你寻找它的链接?发现了什么?试过什么? –

+0

在该页面上使用http://jquery.malsup.com/cycle/ – maximkou

回答

3

例如在Jquery APIdemo

教程daneden.me

he text and image in such a way that image slides from left and then the text slides from right on clicking a button by using jquery/javascript 

这你把里面的div,这是olution:

<!DOCTYPE html> 
<html> 
<head> 
<style> 
div { 
position: relative; 
background-color: #abc; 
width: 40px; 
height: 40px; 
float: left; 
margin: 5px; 
} 
</style> 
<script src="http://code.jquery.com/jquery-1.9.1.js"></script> 
</head> 
<body> 
<p><button id="go">Run »</button></p> 
<div class="block"></div> <div class="block"></div> 
<div class="block"></div> <div class="block"></div> 
<div class="block"></div> <div class="block"></div> 
<script> 
$("#go").click(function(){ 
$(".block:first").animate({ 
left: 100 
}, { 
duration: 1000, 
step: function(now, fx){ 
$(".block:gt(0)").css("left", now); 
} 
}); 
}); 
</script> 
</body> 
</html> 
+0

我的回答对你有帮助吗? @Thejdepp –

+0

谢谢@Mirko Cianfarani我会检查这个并让你知道 – Thejdeep

+0

我会等待你的消息@Thejdeep –