Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
100
rated 0 times [  103] [ 3]  / answers: 1 / hits: 42328  / 12 Years ago, thu, september 27, 2012, 12:00:00

I'm trying to remove the border of a div, but no luck. I've commented out the code in my css and it is the correct property that I want to remove. Here is the code I'm using currently. The background-color change is working that's in the code below but the removeClass is not.



var tab = getURLParameter(tab);

// Disable the visual style of the button since it is disabled for this page.
if (tab == Property) {
$(.scrape-button).css('background-color', '#efefef');
$(.scrape-button:hover).removeClass('border');
}


Any ideas? Thanks!


More From » jquery

 Answers
16

The jQuery selector with hover pseudo class has no effect because there is no element in the page with hover state. I recommend you to try a different aproach



<script>
var tab = getURLParameter(tab);

if (tab == Property) {
$(.scrape-button).addClass(disabled)
}
</script>
<style>
.disabled {
background-color: #EFEFEF;
}

.disabled:hover {
border: none;
}
</style>

[#82875] Wednesday, September 26, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
elijahm

Total Points: 674
Total Questions: 124
Total Answers: 79

Location: Northern Mariana Islands
Member since Fri, Jan 15, 2021
3 Years ago
elijahm questions
Thu, Dec 9, 21, 00:00, 3 Years ago
Mon, Aug 9, 21, 00:00, 3 Years ago
Fri, Mar 19, 21, 00:00, 3 Years ago
Wed, May 27, 20, 00:00, 4 Years ago
;