Reputation: 117
This code works fine in all browsers except Google Chrome, anybody know why?
$(document).ready(function () {
var $1 = $(".1"),
$title = $(".admintitle"),
$box = $(".uno"),
flag = false,
flag2 = false,
height = $1.height();
$title.click(function () {
$1.animate({
height: flag ? height : 40
}, function () {
$box.css('overflow', flag ? 'hidden' : 'visible')
$title.css('background-position', flag ? '-254px 0px' : '0px 0px')
});
flag = !flag;
});
});
Upvotes: 0
Views: 87
Reputation: 117
The final code and correct is this
$(document).ready(function () {
var $1 = $(".admin"),
$title = $(".admintitle"),
$box = $(".uno"),
flag = false,
flag2 = false,
height = $1.height();
$title.click(function () {
$1.animate({
height: flag ? height : 40
}, function () {
$box.css('overflow', flag ? 'hidden': 'visible')
$title.css('background-position', flag ? '-254px 0px': '0px 0px')
});
flag = !flag;
});
});
thanks everybody really!
Upvotes: 0
Reputation: 61143
One possibility is that you're using numbers as class values. That's not strictly prohibited, but it can require different selection tactics:
var $1 = $(".1")
becomes
var $1 = $('div[class~="1"]');
Upvotes: 3