Sowmiya P Sowmiya P - 1 year ago 135
jQuery Question

jumbotron and carousel padding

I have a carousel in home page and jumbotron class resides Below that carousel.I give padding-top for the jumbotron. It reflects the other pages not having carousel.It happens only in mobile view.
To fix this issue,I put the following jquery code in .js file

if($(".body_content").hasClass( ".carousel" )){

But this works on all pages including home page.
Can anybody give me the solution? Please give me...

Answer Source
//Will check if "carousel" exist in page or not.
if ( $( ".carousel" ).length ) { 

//Media query CSS (So it can be affected to mobile view only)
@media screen and (max-width: 900px) {
    .home-jumbotron {
          padding-top: 280px;
    .not-home-jumbotron {
          padding-top: 0px;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download