12
2020
06

图片垂直水平居中

/*图片垂直水平居中*/

.middleCenter {

  position: absolute;

  top: 0;

  bottom: 0;

  left: 0;

  right: 0;

  max-width: 100%;

  max-height: 100%;

  display: block;

04
2020
05

表单提交框在新窗口中打开

<form name="alipayment" action="" method="post" target="_blank">

29
2020
04

asp日期转时间戳

<%

function getTimeNum(dateStr) '日期转为时间戳

if dateStr<>"" then

getTimeNum=DateDiff("s","1970/01/01",dateStr)

28
2020
04

jquery 或者说javascript中的加法运算

加法运算 ?想必大家听到这都会不屑了,加法运算这是多么简单的运算。然而有的时候在Jquery也让人挺头疼的。

28
2020
04

jQuery简单加法计算

<script>

        //文档准备就绪函数

        $(function () {

            //添加加法计算事件

            $("#Button1").click(function () {

28
2020
04

jQuery中对数字进行加减乘除

jQuery中如何实现对数字的加减乘除?


要先把获取的属性值或者元素值转换为整型【parseInt()取整函数】或者浮点型【parseFloat()取浮点数函数】


示例:


(function($){


     var  price = $('.price').val();


28
2020
04

JS中String转int,JS中字符串转数字

方案一代码:

28
2020
04

初始化页面时用jquery重置select下拉菜单选项

  • $("#types option:eq(0)").attr("selected","true");-

  • 将某个id下的option的第一个selected属性设置为true

  • $("#types option:gt(0)").removeAttr("selected");

27
2020
04

JS/Jquery实现select选中option触发事件

js

27
2020
04

jquery获取select选中的value值

误区:

          一直以为jquery获取select中option被选中的文本值,是这样写的: