logo
down
shadow

different CSS style class on page load for mobile and desktop


different CSS style class on page load for mobile and desktop

By : Rajib Rezwan
Date : November 22 2020, 04:01 AM
I think the issue was by ths following , Someone has posted something similar earlier, but removed the answer, after a little bit of tinkering I got this to work. By default the sidebar doesn't have 'active' class set. Also by default it is hidden for mobile, but displayed for desktop. 'active' class gives the ability to display the sidebar on mobile.
code :
/* small screen, hidden by default */
@media only screen and (max-width: 770px ) {
    .sidebar {
        transform: translateY(-100%);
        transition: all .25s ease-in-out;
    }
}

/* large screen, shown by default */
@media only screen and (min-width: 771px ) {
    .sidebar {
        transform: translateY(0);
        transition: all .25s ease-in-out;
    }
    #sidebar-toggle {
        display: none;
    }
}

/* activate the menu on small screen */
.sidebar.active {
    transform: translateY(0);
    transition: all .25s ease-in-out;
}


Share : facebook icon twitter icon
How to load Desktop version of webpage through mobile PHP page (user agent settings?)

How to load Desktop version of webpage through mobile PHP page (user agent settings?)


By : mikefabiyi
Date : March 29 2020, 07:55 AM
I hope this helps . Spoofing the user agent string will be a challenge, as it requires you to control the behavior of the browser. You might be able to do it with JavaScript or something, but I doubt it.
If it's just one site, you may wish to take a look at how they're handling redirection of mobile devices. Often, sites will provide mechanisms for overriding the redirect script.
Web page can load in a desktop browser but not in mobile Safari nor a UIWebView

Web page can load in a desktop browser but not in mobile Safari nor a UIWebView


By : Black Lotus
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , Because the server (at Apple) detects that the user-agent is an iPad and probably sends a redirect to a different URL scheme (the App Store's scheme in this case).
Just tested out that url, on my iPad, with Dolphin browser, using the desktop mode (different user-agent), and it worked perfectly.
Create a Cookie Remembering if Page Should Load Mobile or Desktop Layout of a Responsive Design

Create a Cookie Remembering if Page Should Load Mobile or Desktop Layout of a Responsive Design


By : rps
Date : March 29 2020, 07:55 AM
Different style for same div in mobile and desktop

Different style for same div in mobile and desktop


By : waion ying
Date : March 29 2020, 07:55 AM
Any of those help If I am not wrong do you want this? click
HTML
code :
<div class="hub_specification">
example html table
</div>
.hub_specification {
    width:100%;
    background-color:red;
    height:20px;  
}
@media only screen and (max-width:350px) {
    .hub_specification {
    width:50%;
    background-color:oink;
    height:20px;  
}
}
Bootstrap 4 Page Layout For Mobile/Desktop Two Sidebars Hidden on Mobile with Header

Bootstrap 4 Page Layout For Mobile/Desktop Two Sidebars Hidden on Mobile with Header


By : user1647285
Date : March 29 2020, 07:55 AM
Hope this helps Well, I'm not completely done with it, but here's the gist of it.
CSS:
code :
body { 
    padding-top:54px;
    height:100%;
    width:100%;
}
#content {
    margin-top: 0px;
    overflow-y: scroll;
    height: calc(100vh - 104px);
}
#page-wrapper {
    height: calc(100vh - 54px);
}
<nav class="navbar navbar-expand-sm navbar-dark fixed-top">
    <ul class="navbar-nav">
        <li class="nav-item active">
            <a id="HeaderLink" class="nav-link btn-raised">
                <span id="HeaderLinkSpan">
                    App Name
                </span>
            </a>
        </li>
    </ul>
    <div class="collapse navbar-collapse justify-content-end">
        <div class="dropdown dropdown-menu-right text-right">
            <button class="btn btn-secondary dropdown-toggle btn-raised" type="button"
                id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                Dropdown:
            </button>
            <div class="dropdown-menu center-dropdown" aria-labelledby="dropdownMenuButton">
                <a class="dropdown-item" href="#">Dropdown Item 1</a>
                <a class="dropdown-item" href="#">Dropdown Item 2</a>
                <a class="dropdown-item" href="#">Dropdown Item 3</a>
                <div class="dropdown-divider"></div>
                <a class="dropdown-item" href="?logout">Logout</a>
            </div>
        </div>
    </div>
</nav>
<body>
<% include ../partials/navheader.ejs %>
<div id="page-wrapper">
  <div class="container-fluid h-100">
    <div class="row h-100">
      <div class="col-2" id="LeftSidebar" style="background-color:blue">
      </div>
      <div class="col-8">
        <div class="row" id="content">
        </div>
        <div class="row no-gutters" style="height:40px;padding-top:7px;">
          <div class="col-10 no-gutters">
            <input type="text" class="form-control" style="width:100%">
          </div>
          <div class="col-2">
            <input type="button" class="btn btn-primary" style="width:100%"></div>
        </div>
      </div>
      <div class="col-2" id="RightSidebar" style="background-color:greenyellow">
      </div>
    </div>
  </div>
</div>
</body>
Related Posts Related Posts :
  • dropdown flexibility?
  • How "d3.translateExtent" coordinate works?
  • Get the element of an array that has an index given by a variable in JavaScript
  • Replace(), replacing a value not specified
  • javascript native equivalent to .each & .attr
  • Fabric getPointer method not working in Firefox
  • JS scripts not working for divs loaded with jQuery's .load()
  • Use xhr code error on switch/case (javascript)
  • ParseFloat return string instead of number in Javascript
  • How to add a custom script into React app component?
  • Show data while it's being sent to the backend
  • selecting a specific class with .parents()?
  • Get value of a selected option in an label with Javascript
  • How Do I get an HOC wrapped component function from enzyme instance when mounting?
  • i want to update the flashdata on every ajax call
  • Cannot find a tag with JSsoup even though the tag exists in Node JS
  • Exporting the RouterModule?
  • Remove the default checked value in radio button and replace it with the another radio button that is click
  • Switch to test for id and perform action based on class
  • JavaScript Random Number Generation: Unique 500 Integers in Space 10^6: Getting Collisions
  • Display files in directory using PHP and jQuery
  • Knockout JS: adding forms in foreach bindings
  • HTML5 Canvas positioning mouse clicking broken
  • JQuery on change fired only after second change of select box
  • Unable to limit WebRTC P2P Multi-participant Receiving Bandwidth
  • What is the RegEx to just return the last part of the URL
  • State Remains Undefined in React
  • removing content on website before a screen reader can read it with either JavaScript or CSS...?
  • on 'click' firing before click
  • Manipulation of an array sent by ajax to a php file, within a function of another file
  • How to use plunker or jsfiddle to run angular2 code
  • JavaScript lexical environments as objects
  • Iteratively position spheres with DOM pixels using three.js and React
  • React trying to access file at a wrong path
  • AES encryption in JS equivalent of C#
  • Filter an Array based off user input string and menu dropdown items
  • Constantly read local file with JS?
  • React navbar handler with theme
  • Show changes to HTML5 canvas immediately
  • Tooltip Stays Hidden In D3 Treemap
  • Backbone - What is the best way to listen to 2 models?
  • formatting an array of objects output
  • Bind input value to specific value in object
  • Animation doesnt work when onClick event occurs (react.js)
  • Consume enum from ambient TypeScript module using @babel/preset-typescript?
  • Changing order of React components only triggers re-render after second click
  • Track the total time the HTMLAudio was playing
  • Call javascript function in PHP file and load html file after?
  • Theme Development: JavaScript not working when linked from functions.php
  • Add attributes to multiple <td> in datatables
  • Progressive loading codesnip not quite understood
  • How to format default date in javascript?
  • Caesar cipher only gets first value right
  • innerText not showing after setting it straight after creating the element
  • How to use HTML template tag with jQuery?
  • Showing v-menue's selected option in another part of the application. Vuetify
  • How can I find and return my div element with rails and javascript?
  • The right way to use Ajax to Update a Single field in a specific Object
  • Hhow to create a react element and apply a javascript method to it
  • Change src of parent window iframe
  • shadow
    Privacy Policy - Terms - Contact Us © bighow.org