473,387 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to display display none as important using jquery

I have a div which is display block (getting the style through jquery) and now I want to make it display none when the user click on it only for the tablet and mobile view. So I used attr('style','display: none !important'). But it is taking display block as default. Is there any solution to overcome this.....
Sep 26 '14 #1
2 9196
Exequiel
288 256MB
$('yourdiv').live('click', function(ev) {
$(this).hide("fast");
// or $(this).css({"display":"none"});
});
Sep 28 '14 #2
Hi Exequiel I used both the methods suggested by you but unfortunately both are returning the same output as before.

This is my code.....

Expand|Select|Wrap|Line Numbers
  1. if(windowWidth < 769) {
  2.                         self.page.on("click",".addonUncheck",function(){
  3.                             $('.singleAddon').attr('style','display: none !important');
  4.                         });
  5.                         self.page.on("click",".deleteAddon",function(){
  6.                             $('#single_addon').show();
  7.                         });
  8.                     }
For desktop view the div is displayed as display: block using jquery now want to make it display: none only for mobile and tablet view... Any suggestions...
Sep 30 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: ruby_bestcoder | last post by:
Hi Im having problem in firefox with display:none/block. I have essentially 3 li elements. In each element there are a few nested div:s. Clicking on one of the divs, makes another div to...
2
by: darrel | last post by:
I'm still struggling to find a javascript/ajax library that I want to stick with for a while. JQuery is looking great these days...refined, LOTS of plug-ins, and an active community. Is...
1
by: jelumalai | last post by:
I am using display:none with using Table. When show the onClick using javascript. Then it will show, again i will hide, content only hidden, but that table doesn't hide. <script> function...
8
pradeepjain
by: pradeepjain | last post by:
hii, I have 3 images for a single id like 00024 in the DB. when ever the user selects the ID from the drop down .all the 3 images must be displayed . how do i do this? this is the image...
0
by: rhtdmrai | last post by:
I want to apply autocomplete in gridview (in asp.net3.5 with C#) using jquery and this gridview is within the ajax update panel <asp:UpdatePanel ID="UpdatePanel1" runat="server"> ...
1
by: apssiva | last post by:
Hello All, 1. First i select the class name in combo box -> using jQuery reload the page. 2. after reload the page, Student name was display in random. so i add two radio button. 1....
0
by: jehkinen | last post by:
how to create depending ajax combobox(like this http://jqueryui.com/resources/demos/autocomplete/combobox.html with autocomplit). using jquery (or using yii extension)?? i'm using this extension...
4
by: Rajesh13 | last post by:
using jquery-ui try to call the content from another html file by using ajaxjquery.. its wont work in local path.? <!doctype html> <html lang="en"> <head> <meta charset="utf-8">...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.