html代码如下所示:
<div class="slides">
<div class="slide" style="width:1007px;height:348px;background:url(./images_w/key_analysis.png) no-repeat; background-position: right bottom;">
</div>
<div class="slide" style="width:1007px;height:348px;background:url(./images_w/key_analysis.png) no-repeat; background-position: right bottom;">
</div>
<div class="slide" style="width:1007px;height:348px;background:url(./images_w/key_analysis.png) no-repeat; background-position: right bottom;">
</div>
</div>
javascript代码如下$(o.slides,$t).css({width:(3*1348)}); //这个是原来的代码,可以改变div slides的宽度
$(o.slide,$t).css({width:(1348)}); //这个是我模仿上面加的代码,想改变div slide的宽度,但是没起作用???
为什么一样的代码,我加的$(o.slide,$t).css({width:(1348)});这句就不起作用呢,在ie里看div slide的宽度还是1007px,没改变
<div class="slides">
<div class="slide" style="width:1007px;height:348px;background:url(./images_w/key_analysis.png) no-repeat; background-position: right bottom;">
</div>
<div class="slide" style="width:1007px;height:348px;background:url(./images_w/key_analysis.png) no-repeat; background-position: right bottom;">
</div>
<div class="slide" style="width:1007px;height:348px;background:url(./images_w/key_analysis.png) no-repeat; background-position: right bottom;">
</div>
</div>
javascript代码如下$(o.slides,$t).css({width:(3*1348)}); //这个是原来的代码,可以改变div slides的宽度
$(o.slide,$t).css({width:(1348)}); //这个是我模仿上面加的代码,想改变div slide的宽度,但是没起作用???
为什么一样的代码,我加的$(o.slide,$t).css({width:(1348)});这句就不起作用呢,在ie里看div slide的宽度还是1007px,没改变
var width = $(o.slides,$t).children().outerWidth();
$(o.slide,$t).css({width:(width)});
var o = $.metadata ? $.extend({}, settings, $t.metadata()) : settings;
var width = $(o.slides,$t).children().outerWidth();
$(o.slide,$t).css({width:(width)});
忘了说了,var o 是定义的代表整个页面。