1

I'm aware i probably cant execute jQuery within a CSS file. But here is my conundrum:

I have several divs with overlays on them. On a desktop the user hovers over the overlay and it slides up revealing content.

On a mobile, there isnt a hover state (gracefully implemented). How can i use my existing Media Query logic to disable jQuery hover on those certain divs?

Any advice welcome, or even for an alternative solution to this problem?

1
  • 1
    It's a better idea to use JavaScript for this, though you may not be able to detect with the exact same conditions as media queries... Commented Jul 13, 2011 at 20:25

1 Answer 1

1

Your code quite probably look like this while running :

<div id="container">
    <div class="item show" />
    <div class="item hide" />
    <div class="item hide" />
    <div class="item hide" />
    <div class="item hide" />
</div>

with hide being something like display:none
and show being display:block

Just change hide to display:block in the good Media Query and mobile user will see all the content! (might have to disable the JS too)

I want to scold you lightly for not putting up any code and having 4k rep :)

Sign up to request clarification or add additional context in comments.

2 Comments

Scolding appreciated. I figured it was more of a conceptual question than an actual code problem :)
My only issue is that I wasn't sure of what you really wanted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.