32220

jQuery accordion hiding tabs in CSS

Question:

I have a <a href="http://api.jqueryui.com/accordion/#option-header" rel="nofollow">jQuery UI accordion</a> with Markup structure

<div id="accordion2"> <h3>title</h3> <div>stuff texty</div> <h3>title2</h3> <div>stuff texty</div> </div>

However, the second tab of the accordion is in a plainer format than the first (i.e. it has less pictures and is hence more mobile friendly).

I am want to use a media query to hide the first tab and its contents when screen width is less than 640px. I tried giving the first h3 and the first div tags a class of first and then used

@media (max-width: 640px) { .first { display: none; } }

To make them disappear... but it didn't work. Does anyone know how I can go about doing this?

Answer1:

try this as a CSS3 option:

#accordion2 h3:first-of-type { display:none; }

if you cannot support CSS3 then give that first heading a class name and target that.

Recommend

  • Create array of regex match(multiline)
  • How to merge two xml file using xslt1.0?
  • codeigniter query controller view
  • Eclipse can't find MinGW. Why?
  • How to access the database from the api controller?
  • Get picture position in Apache POI from Excel xls HSSF
  • FSO returns non-existing subfolders
  • iOS - How to access the device's file library?
  • Rails Route parameters in AngularJS
  • SEO friendly 301 redirect .htm to .aspx
  • cordova build android throws error on Ubuntu 12.04
  • How do I recognize a line break with a switch case that evaluates a char in Java?
  • How to add System.Windows dll to Visual Studio 2010 express?
  • Unique SMS sender id?
  • jQueryMobile, Ajax Navigation, and MVC
  • Which browser have this strange user agent? (IOS device)
  • Hiding Directories Programatically in C#
  • Outlines on links in IE9 remains when focus is changed
  • hide missing dates from x-axis ggplot2
  • Find Previous month name using Calender or any classes that in java
  • Possible to “watch” both HAML and SASS at the same time?
  • How to specify input and output paths from cmd.exe for a PowerShell script?
  • How integrated is Collada to OpenGL ES
  • Alternative to overridePendingTransition() - Android
  • Date Conversion from yyyy-mm-dd to dd-mm-yyyy
  • Alternative To body {overflow:scroll;} That Will Prevent Page Jostling/Wriggling?
  • Textfile Structure (tables)
  • Setting up SourceTree to merge unity3d scenes with UnityYAMLMerge
  • MongoDB in PHP using aggregate to group by _id is null not working
  • Email format validation in mvc3 view
  • Cannot connect to cassandra from Spark
  • Display issues when we change from one jquery mobile page to another in firefox
  • Fill an image in a square container while keeping aspect ratio
  • Font Awesome Showing Box instead of Icons
  • To display the title for the current loaction in map in iphone
  • Properly structure and highlight a GtkPopoverMenu using PyGObject
  • trying to dynamically update Highchart column chart but series undefined
  • Is it possible to post an object from jquery to bottle.py?
  • Python/Django TangoWithDjango Models and Databases
  • How to push additional view controllers onto NavigationController but keep the TabBar?