如何将一个类添加到li
已经分配给它的类的现有类中?
我当前的代码在 http://jsfiddle.net/GbPdV/
我想将“Open”类添加到:
< li class="dropdown hover carticon cart" >
我认为这必须发生在内部:(不确定)
if ( response.Status == "Success" )
{
$.ajax({
type: "GET",
url: "dmiajax.aspx?request=FloatingCart&extra=" + rnd(),
dataType: "html",
success: function(response) {
var floatingCart = $("ul.dropdown-menu.topcart");
if (floatingCart.length == 0) {
floatingCart = $('<ul class="dropdown-menu topcartopen"></ul>').insertBefore(".pull-right");
floatingCart.hoverIntent({
over: function() {},
timeout: 200,
out: function() {
$(this).stop(true, true).filter(":visible").hide("drop", {
direction: "down"
});
}
});
}