您的位置:首页 > Web前端 > JQuery

8个对程序员来说有用的jQuery小贴士和技巧

2014-03-09 22:26 453 查看

 1) 禁用鼠标右键单击

  jQuery程序员可以使用此代码在网页上禁用鼠标右键点击。

  2) 利用jQuery调整文字大小

  使用此代码,用户可以重新网站上文字的大小(增大和减少)

  3) 在新的Windows打开链接

  Try this code and increase your site impressions because using this jquery code users will go on new window after clicking on any link of your site. Code is below: -

  4) Style Sheets Swap

  Swap style sheets using this code and the “Style sheets swap” script is below: -

  5) 回到顶部链接

  That is very common function you can see on eve site nowadays is ” Back to Top”. This functionality is very useful for long pages for make short in a single click. Visit this code below: -

  6) 获取鼠标光标的x和y轴

  You can find the values of X and Y coordinator of mouse pointer. Code is blow : -

  7) 检测当前鼠标坐标

  使用这个脚本,你可以在jQuery所支持的任何Web浏览器找到当前鼠标的坐标。代码如下:

});

  8) 在jQuery中预加载图片

  此图像预加载的脚本有助于非常快速加载图像或网页。你不必等待图像加载。代码:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: