jquery ajax tips,javascript - jQuery Tips and Tricks - Stack Overflow

本文推荐了Jeffery Way的jQuery入门系列教程,帮助新手掌握基本技巧,如动画和元素操作。着重讲解了如何通过jQuery实现文本大小调整,结合CSS样式,轻松上手。通过实例‘ResizingText’演示了JavaScript方法的应用。
摘要由CSDN通过智能技术生成

Speaking of Tips and Tricks and as well some tutorials. I found these series of tutorials (“jQuery for Absolute Beginners” Video Series) by Jeffery Way are VERY HELPFUL.

It targets those developers who are new to jQuery. He shows how to create many cool stuff with jQuery, like animation, Creating and Removing Elements and more...

I learned a lot from it. He shows how it's easy to use jQuery.

Now I love it and i can read and understand any jQuery script even if it's complex.

Here is one example I like "Resizing Text"

1- jQuery...

$(function() {

$('a').click(function() {

var originalSize = $('p').css('font-size'); // get the font size

var number = parseFloat(originalSize, 10); // that method will chop off any integer from the specified variable "originalSize"

var unitOfMeasure = originalSize.slice(-2);// store the unit of measure, Pixle or Inch

$('p').css('font-size', number / 1.2 + unitOfMeasure);

if(this.id == 'larger'){$('p').css('font-size', number * 1.2 + unitOfMeasure);}// figure out which element is triggered

});

});

2- CSS Styling...

body{ margin-left:300px;text-align:center; width:700px; background-color:#666666;}

.box {width:500px; text-align:justify; padding:5px; font-family:verdana; font-size:11px; color:#0033FF; background-color:#FFFFCC;}

2- HTML...

Larger |

Smaller

In today’s video tutorial, I’ll show you how to resize text every time an associated anchor tag is clicked. We’ll be examining the “slice”, “parseFloat”, and “CSS” Javascript/jQuery methods.

Highly recommend these tutorials...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值