I’m trying to set opacity of element by jQuery.
$('[class*="OtherFeatur"]').load(function(){
$(this).fadeTo(500, 0.5);
});
is not working but when I do
$('[class*="OtherFeatur"]').fadeTo(0,0.5);
it will be affected. where is problem of first code?
and which one is better ,set opacity by jQuery or CSS?
how can I do it by css ,that all browser can show it?
.load()– Load data from the server and place the returned HTML into the matched element.So this function works for loading data from the another resource to the element you selected.
probably you need page load event:
or if you loads some data, specify the source first in the
.load()method.in this case function will be invoked after loading the content.