RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
jquery图片翻转,jquery图片切换

jquery 让图片旋转30度怎么写啊

用jquery 给图片添加css样式,用css样式来控制旋转:

成都创新互联公司专注于铜川企业网站建设,响应式网站开发,商城网站建设。铜川网站建设公司,为铜川等地区提供建站服务。全流程按需求定制制作,专业设计,全程项目跟踪,成都创新互联公司专业和态度为您提供的服务

CSS3 transform 属性

transform具体的用法去百度吧 ,手册里解释很全面

jquery 图片翻转原理?

大致原理如下:

//初始化界面

var itemList, item, className, thisItem, newOrder, itemDesc, desc;

itemList = $('#itemlist');

item = itemList.children('img');

itemDesc = $('#itemdescription');

desc = itemDesc.children('span');

//为每个项目添加类名称

item.each(function(index) {

className = 'item-' + index;

$(this).addClass(className).attr('data-order', index);

});

//显示第一个项目描述

desc.filter(':first-child').fadeIn();

//在点击时激活动画

item.on('click', function() {

thisItem = $(this);

thisOrder = parseInt(thisItem.attr('data-order')) - 1;

thisItem.addClass('show');

//重排项的位置

item.on('animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd', function() {

thisItem.removeClass().addClass('item-0').attr('data-order', '0');

//显示选定的项目描述

desc.hide();

desc.filter('[data-for=' + thisItem.attr('id') + ']' ).fadeIn('fast');

});

//兄弟项目向后移动

window.setTimeout(function () {

for(var i = thisOrder; i = 0; i--) {

//重排项位置

movedItem = item.filter('[data-order=' + i + ']');

newOrder = parseInt(movedItem.attr('data-order')) + 1;

className = 'item-' + newOrder;

//动态过渡

movedItem.removeClass().addClass('transition ' + className).attr('data-order', newOrder);

//删除他们的过渡

item.on('transitionend webkitTransitionEnd MSTransitionEnd oTransitionEnd', function() {

item.removeClass('transition');

});

}

}, 500);

});

});

如果你希望它更智能,那么你就需要多下点功夫了。其实,道理都是一样的,只不过做成什么样的效果更好看而已。

jQuery图片旋转插件jQueryRotate.js用法实例(附demo下载)

本文实例讲述了jQuery图片旋转插件jQueryRotate.js用法。分享给大家供大家参考,具体如下:

推荐一个图片旋转插件,用于浏览相册时,旋转图片。

运行效果截图如下:

点击此处查看在线演示效果。

具体代码如下:

script

type="text/javascript"

$(document).ready(function

()

{

$("#images").rotate(45);

var

value

=

$("#images1").rotate({

bind:

{

mouseover:

function(){

value

+=90;

$(this).rotate({

animateTo:value})

}

}

});

$('#button').click(function(){

$("#images1").rotate({animateTo:parseInt($('#angel').val())});

});

function

rotation

(){

$("#images2").rotate({

angle:0,

animateTo:360,

callback:

rotation,

easing:

function

(x,t,b,c,d){

return

c*(t/d)+b;

}

});

}

rotation();

});

/script

上面只是js代码,完整实例代码点击此处本站下载。

更多关于jQuery插件相关内容感兴趣的读者可查看本站专题:《jQuery常用插件及用法总结》

希望本文所述对大家jQuery程序设计有所帮助。


名称栏目:jquery图片翻转,jquery图片切换
标题路径:http://scyingshan.cn/article/dsiggos.html