`
270279long
  • 浏览: 9949 次
社区版块
存档分类
最新评论
文章列表
html标签的自定义属性js赋值方式有两种: 1、(隐式的方法)document.getElementById("testId").ggg = "new"; 这种方法直接通过"."来给testID 设置属性ggg=“new”,这种方法在前台不会展示该属性,用$("#testId")[0].outerHTMl 也看不到ggg这个属性,用jquery方法$("#testID").attr("ggg") 也获取不到ggg 属性的值。 2、(显示的方法)document.getEle ...
document.activeElement && document.activeElement.type == "button"
encodeURIComponent() 函数是js的原生函数,通过它可将url中的特殊符号编码,在action端无需解码,自动还原成原来的参数
var bro = $.browser; if (bro.msie && (bro.version < 9||document.documentMode<9))
// 修理火狐、chrome的页内锚点 function fixAnchorInPage(iframe) { $(iframe).contents().find('a').each(function() { var link = $(this); var href = link.attr('href'); if (href && href.substring(0, 1) == '#') { var name = href.substring(1); $(this).click(function() { var nameElement = $(if ...

窗口滚动事件

    博客分类:
  • js
function addScrollListener(){     $(window).bind("scroll", function() {         var scrollTop = $(document).scrollTop();         var totalHeight = document.body.scrollHeight;         var windowHeight = $(window).height();         if ((scrollTop + windowHeight) / totalHeight > 0.8) {      ...
$('#divFloatToolsView').animate({width: 'hide', opacity: 'hide'}, 'normal', function(){$('#divFloatToolsView').hide();} ); 向右收缩弹出层,在执行动画的过程中,不会阻塞后面代码的执行

-省略样式:

    博客分类:
  • ui
li{overflow:hidden;text-overflow:ellipsis;} .td_ellipsis {word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

html 控制IE模式

    博客分类:
  • ui
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 通过下面这一行可以控制IE的Document Mode <meta http-equiv="X-UA-Compatible" content="IE=8;IE=9" />
<iframe src="需要连接的iframe地址" id="iframepage" name="iframepage" frameBorder=0 scrolling=no width="100%" onLoad="iFrameHeight()" > </iframe> js代码:function setIFrameHeight(iframe) {     var oHeight = 0;     var sHeight = 0;     var cHeight = ...
Global site tag (gtag.js) - Google Analytics