Jquery Image Zoom and Draggable Test

别人做的很好,不知如何做既可以拖又可以放大的东西,逐渐摸索中,此为第一版本

<!DOCTYPE html>

<html lang="en">
    <head>
        <title>Image Zoom Tour with jQuery</title>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="Image Zoom Tour with jQuery" />
        <meta name="keywords" content="jquery, zoom, tour, images, zoom in, zoom out, plugin, css3" />
        <meta name="author" content="Codrops" />
        <link rel="shortcut icon" href="../favicon.ico">
        <link rel="stylesheet" type="text/css" href="css/demo.css" />
        <link rel="stylesheet" type="text/css" href="css/style.css" />
        <noscript>
            <link rel="stylesheet" type="text/css" href="css/styleNoJS.css" />
        </noscript>
        <link href='http://fonts.googleapis.com/css?family=PT+Sans+Narrow&v1' rel='stylesheet' type='text/css' />
        <link href='http://fonts.googleapis.com/css?family=Ultra' rel='stylesheet' type='text/css' />
    </head>
    <body>
<table width="100%">
<tr>
    <td colspan="4">
        <table border="0" cellpadding="0" cellspacing="0">
            <tbody><tr>
                <td colspan="1" style="background-color: White;" align="left" height="60" width="10">
                </td>
                <td colspan="3" class="landingLeftBack5" height="30" width="773">
                </td>
            </tr>
        </tbody></table>
    </td>
</tr>
<tr>
    <td colspan="1" width="22">
    </td>
    <td colspan="1" valign="top" width="374">
        <table border="0" cellpadding="0" cellspacing="0" width="374">
            <tbody><tr>
                <td align="center" height="222px" valign="top">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tbody><tr>
                            <td height="20px">
                            </td>
                        </tr>
                        <tr>
                            <td class="Font14" align="left">
                                <font class="gallaryContentTitle">                                                     
                                Genova, <a href="../hardwood-flooring/Genova/Hickory/Bologna5-flooring.aspx" class="promoLinkGallery">Bologna</a> 5"(Hickory)
                                   
                                
                                </font>
                            </td>
                        </tr>
                        <tr>
                            <td height="15px">
                            </td>
                        </tr>
                        <tr>
                            <td class="ContentLanding" align="left" valign="top">
                              ttt                   
                            </td>
                        </tr>
                        <tr>
                            <td height="15px">
                            </td>
                        </tr>
                        <tr>
                            <td class="gallaryContentTitle" align="left" valign="top">
                               tail                   
                            </td>
                        </tr>
                    </tbody></table>
                </td>
            </tr>
        </tbody></table>
    </td>
    <td colspan="1" width="22">
    </td>
    <td colspan="1" valign="top" width="364">
        <img id="Image9" alt="wood flooring" title="wood flooring" src="../Images/ style="width:365px;border-width:0px;">
    </td>
</tr>

<tr>
    <td colspan="4" width="418">


       <div id="mainImage" style="margin-top: 15px; top: 32px; height: auto;">
        <div id="draggable">
            <img id="mainViewerImage" src="http://s7d4.scene7.com/is/image/roomandboard/anson_826455_13e?$truvu0$&wid=310" />

        </div>
       </div>
       <script>
       /*
           $(function() {
           $("#draggable")
               .resizable()
               .draggable();
               //$("#draggable").draggable();
           });
           */
           var clickTimes = -1;
           
           var width = 0;
           var height = 0;
           $("#mainViewerImage").click(function() {

               if (clickTimes == -1) {
                   width = $(this).width();
                   height = $(this).height();
                   clickTimes = 0;
               }
               if (clickTimes < 2) {
                   //$("#draggable").draggable('disable');
                   $(this).width($(this).width() + 200);
                   $(this).height($(this).height() + 200);
                   $(this).css({
                       'margin': '0',
                       'cursor': 'url(http://www.roomandboard.com/rnb/img/cur/mag_in.cur),point'
                   });
                   clickTimes++;
                   if (clickTimes == 2) {

                      
                       $(this).css({
                           'margin': '0',
                           'cursor': 'move'
                       });
                       
                   }
                   else {
                       
                       
                   }
               }
               else {

                   $("#draggable").draggable();
                   $(this).css({
                       'margin': '0',
                       'cursor': 'url(http://www.roomandboard.com/rnb/img/cur/mag_in.cur),point'
                   });

                   $(this).width(width);
                   $(this).height(height);
                   clickTimes = 0;




               }

           });
           
           
        </script>

        <table width="411">
            <tbody><tr>
                    <td colspan="1" style="background-color: White;" align="left" height="60" width="13">
                </td>
                <td width="127">
                    <img id="mainViewerImage" src="images/gallary15b.jpg" style="height:110px;width:127px;border-width:0px;">
                </td>
                <td height="4">
                </td>
                <td width="126">
                    <img id="imggallary19b" src="images/gallary15b.jpg" style="height:110px;width:127px;border-width:0px;">
                </td>
                <td height="4">
                </td>
                <td width="126">
                                        
                </td>
            </tr>
            <tr>
                <td colspan="6" height="7">
                </td>
            </tr>
            <tr>
                    <td colspan="1" width="10">
                </td>
                <td colspan="5" class="gallaryContentTitle" height="10">
                    Rollover Image to Enlarge
                </td>
            </tr>
            <tr>
                <td colspan="5" height="7">
                </td>
            </tr>
        </tbody></table>
    </td>
</tr>
</table>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
附加JavaScript和CSS文件到你的文档。编辑CSS文件并且 匹配你的图片路径,同时改变颜色匹配你网站的主题 重要:像例子中一样确定包含的JavaScript文件 具体顺序。 <link rel="stylesheet" media="screen" type="text/css" href="css/zoomimage.css" />[removed][removed][removed][removed][removed][removed]调用代码 你所需要做的所有事就是使用jQuery的方式选择一个元素并且调用插件。 $('a.myLinks').zoomimage(options); 可选项 一个哈希参数。所有的参数都是可选的。 Opacity float 控制栏和标题栏的不透明度。默认: 0.3 border integer 图片的边框宽度。默认: 0 duration integer 动态化持续时间。默认: 300 译者注:控制图片放大的时间和标题栏、控制栏显示的时间,两个操作不同步进行。 easing string 动画缓和。默认: linear prevent integer 拖动图像前忽略的位移像素(防止鼠标的意外拖动所用)。默认: 14 译者注:防止鼠标按下后意外移动导致图像发生位移。 controls boolean 是否显示控制条(如果一个图片组中只有一张图片,则控制条不显示)。默认: true caption boolean 是否显示标题(标题的内容来源于a标签的title属性)。默认: true centered boolean 图片放大后是否在浏览器中心显示。默认: false hideSource boolean 图片放大后是否影藏原微缩图像。默认: false className string 用户自定义的CSS样式名。默认: false。 译者注:false时使用zoomimage.css文件,className即为css文件名同时也是css类名。 controlsTrigger string 控制标题的显示样式,'focus'图像获取到焦点是显示标题,'mouseover'鼠标悬停在图片上时显示标题。默认: 'focus' preload string 预处理,'click'当点击是加载图片 ,'load'文档载入时就加载图片。默认: 'click' onLoad function 回调函数,当图像被加载的时候触发 beforeZoomIn function 回调函数,在图像被放大前触发 onZoomIn function 回调函数,在图像被放大时触发 beforeZoomOut function 回调函数,在图像被缩小前触发 onZoomOut function 回调函数,在图像被缩小时触发 onFocus function 回调函数,当图片获取焦点时触发 关闭所有图片或移除节点 如果你想关闭所有打开的图片或像不通过触发器清除图片(从DOM移除),那么你可以使用 'zoomimageClear'。这个插件的这个选择器永远是 'div.zoomimage'. $('div.zooimage').zoomimageClear();阴影设置 你可以自定义阴影。要做到这一点你必须明白如何布局框来呈现阴影。 每个CSS类负责一个特定区域的阴影。你可以在类中改变背景图片的位置和大小。
毕业设计,基于SpringBoot+Vue+MySQL开发的影城管理系统,源码+数据库+论文答辩+毕业论文+视频演示 随着现在网络的快速发展,网上管理系统也逐渐快速发展起来,网上管理模式很快融入到了许多生活之中,随之就产生了“小徐影城管理系统”,这样就让小徐影城管理系统更加方便简单。 对于本小徐影城管理系统的设计来说,系统开发主要是采用java语言技术,在整个系统的设计中应用MySQL数据库来完成数据存储,具体根据小徐影城管理系统的现状来进行开发的,具体根据现实的需求来实现小徐影城管理系统网络化的管理,各类信息有序地进行存储,进入小徐影城管理系统页面之后,方可开始操作主控界面,主要功能包括管理员:首页、个人中心、用户管理、电影类型管理、放映厅管理、电影信息管理、购票统计管理、系统管理、订单管理,用户前台;首页、电影信息、电影资讯、个人中心、后台管理、在线客服等功能。 本论文主要讲述了小徐影城管理系统开发背景,该系统它主要是对需求分析和功能需求做了介绍,并且对系统做了详细的测试和总结。具体从业务流程、数据库设计和系统结构等多方面的问题。望能利用先进的计算机技术和网络技术来改变目前的小徐影城管理系统状况,提高管理效率。 关键词:小徐影城管理系统;Spring Boot框架,MySQL数据库
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值