WordPress.org

Ready to get started?Download WordPress

Forums

Media query question (2 posts)

  1. kmadrid
    Member
    Posted 6 months ago #

    Wondering if there is any way I can use a media query to construct a new window or tab url if the user is accessing via mobile, versus a modal pop-up if the user is accessing via monitor. I've tried eight gazillion different modal window plugins and css/js/html to get the content to work on a phone; unfortunately the content for the modal window was provided by a government agency with strict instructions not to reformat, and it just doesn't work in a mobile modal popup. Also, the url content is updated with numbers via javascript, so that needs to work too. Advice?

  2. bcworkz
    Member
    Posted 6 months ago #

    Media queries can only effect how HTML is shown on a page. They cannot actually change the HTML or cause the browser to do things like open new windows. You need to use javascript or jQuery to take action based on the device's browser. If it's a mobile browser, launch a new window, otherwise launch the modal.

Reply

You must log in to post.

About this Topic