on click函数在加载时被触发

时间:2015-10-12 06:39:42

标签: jquery

我有一个jQuery点击功能,但该功能在页面加载时被调用

jQuery("[tm-gb]").on("click change", function(event) {

}

有没有办法在页面加载时调用此函数?

1 个答案:

答案 0 :(得分:-1)

如果您想在页面加载时调用,可以使用background-image函数:

.combo {
  background-image: radial-gradient(ellipse at 101.3% 111.9%, rgba(255, 255, 255, 0) 84.79%, rgba(255, 255, 255, 0.09) 85.69%, rgba(255, 255, 255, 0.09) 100%), linear-gradient(to bottom, #484848 0%, #3b3b3b 50%, #484848 100%);
  background-size: 266% 232%, 100% 100%;
}

您可以使用加载事件

.combo {
  background-image: radial-gradient(ellipse at 101.3% 111.9%, rgba(255, 255, 255, 0) 84.79%, rgba(255, 255, 255, 0.09) 85.69%, rgba(255, 255, 255, 0.09) 100%), linear-gradient(to bottom, #484848 0%, #3b3b3b 50%, #484848 100%);
  background-size: 266% 232%, 100% 100%;
}
div {
  position: relative;
  height: 50px;
  width: 200px;
  border: 1px solid;
}