How to slide text and images from left to right with sliding effect(如何使用滑动效果从左向右滑动文本和图像)
问题描述
我正在创建一个网页,我需要在其中滑动文本和图像,使图像从左侧滑动,然后使用 jquery/javascript 单击按钮时文本从右侧滑动.
I am creating a web page where I need to slide the 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.
请检查此滑块 我希望我的文本和图像像这样滑动
Please check this slider I want my texts and image to slide like this
请用必要的 js/JQuery 建议我
Please suggest me with necessary js/JQuery
推荐答案
Jquery API 和示例演示
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 里面,这是一个解决方案:
This you put inside the div and this is a solution:
<!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>
这篇关于如何使用滑动效果从左向右滑动文本和图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用滑动效果从左向右滑动文本和图像


基础教程推荐
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- Bokeh Div文本对齐 2022-01-01