function getParent($this) {
var selector = $this.attr('data-target') //The jQuery attr() method is also used to set/change attribute values.
//for ie7
if (!selector) {
selector = $this.attr('href')
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
var $parent = selector && $(selector)
return $parent && $parent.length ? $parent : $this.parent()
}
慕容708150
相关分类