1

CODE:

<ul class="ul_list" style="height: 300px;resize:both;">

How do I find that using JQuery in a page and remove resize:both. I can't do it manualy. Please advise.

4

4 回答 4

3

From http://api.jquery.com/css/:

Setting the value of a style property to an empty string — e.g. $( "#mydiv" ).css( "color", "" ) — removes that property from an element if it has already been directly applied, whether in the HTML style attribute, through jQuery's .css() method, or through direct DOM manipulation of the style property. It does not, however, remove a style that has been applied with a CSS rule in a stylesheet or element.

$('.ul_list').css('resize','');

And, just because I love fiddles: http://jsfiddle.net/CFCGV/

于 2013-09-20T21:58:02.037 回答
0
$('.ul_list').css({'resize':'none'});
于 2013-09-20T21:55:26.997 回答
0

You won't be able to completely remove the style, but you can set it back to the default using something like:

$(document).ready(function(){
    $('.ul_list').css('resize':'none');
});
于 2013-09-20T21:56:55.210 回答
0

Never use inline styles in your code, CSS have specificity and cascading nature.

move the resize:both to the external css file, and if you want to change any time, use another css class, and add the class using JavaScript.

This video will be helpful for you http://www.youtube.com/watch?v=SLC83iesr60

于 2013-09-20T22:00:19.877 回答