XF 1.2 Slider with responsive setup not working in pages

TsinJu

Well-known member
I am trying to add a Liquid Slider to a Page that i have added in ACP -> Applications - Node Tree - Create Node -> Page selected.

Adding the Code in "Page Options" isn't the Problem, the Slider gets displayed.
But when it comes to the responsive Options, just smaller your Browser at the Samples Pages, it wont work in Xenforo Pages and i dont get it why.
I an normal html File the responsive option is working fine but as soon as i add everything into a Page there is no responsive

Attached are all Files i am using. Please delete .txt to get the js and css format back
The responsive Option is added into jquery.liquid-slider-custom.min.js
All Files are uploaded into /js/wiki_slider/ just for testing

I have not added any typically Xenforo format like baseHtml or sectionMain. I just wanted to get it working first

Here´s the Demo Code i am using
HTML:
  <link rel="stylesheet" href="/js/wiki_slider/animate.css"> <!-- Optional -->
  <link rel="stylesheet" href="/js/wiki_slider/liquid-slider.css">

  <!-- Liquid Slider relies on jQuery - Using the older one like it´s documented at liquid´s page -->
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  <!-- More scripts below! -->

<h1 style="margin:100px 200px">Liquid Slider 2</h1>
  <div class="liquid-slider"  id="main-slider">
    <div>
      <h2 class="title">Slide 1</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas metus nulla, commodo a sodales sed, dignissim pretium nunc. Nam et lacus neque. Sed volutpat ante id mauris laoreet vestibulum. Nam blandit felis non neque cursus aliquet. Morbi vel enim dignissim massa dignissim commodo vitae quis tellus. Nunc non mollis nulla. Sed consectetur elit id mi consectetur bibendum. Ut enim massa, sodales tempor convallis et, iaculis ac massa. Etiam suscipit nisl eget lorem pellentesque quis iaculis mi mattis. Aliquam sit amet purus lectus. Maecenas tempor ornare sollicitudin.</p>
    </div>
    <div>
      <h2 class="title">Slide 2</h2>
      <p>Proin nec turpis eget dolor dictum lacinia. Nullam nunc magna, tincidunt eu porta in, faucibus sed magna. Suspendisse laoreet ornare ullamcorper. Nulla in tortor nibh. Pellentesque sed est vitae odio vestibulum aliquet in nec leo.</p>
    </div>       
    <div>
      <h2 class="title">Slide 3</h2>
      <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
    </div>
    <div>
      <h2 class="title">Slide 4</h2>
      <p>Proin nec turpis eget dolor dictum lacinia. Nullam nunc magna, tincidunt eu porta in, faucibus sed magna. Suspendisse laoreet ornare ullamcorper. Nulla in tortor nibh. Pellentesque sed est vitae odio vestibulum aliquet in nec leo.</p>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas metus nulla, commodo a sodales sed, dignissim pretium nunc. Nam et lacus neque. Sed volutpat ante id mauris laoreet vestibulum. Nam blandit felis non neque cursus aliquet. Morbi vel enim dignissim massa dignissim commodo vitae quis tellus. Nunc non mollis nulla. Sed consectetur elit id mi consectetur bibendum. Ut enim massa, sodales tempor convallis et, iaculis ac massa. Etiam suscipit nisl eget lorem pellentesque quis iaculis mi mattis. Aliquam sit amet purus lectus. Maecenas tempor ornare sollicitudin.</p>
    </div>
  </div>
  <!-- Feel free to load scripts in the footer -->
  <script src="/js/wiki_slider/jquery.easing.1.3.js"></script>
  <script src="/js/wiki_slider/jquery.touchSwipe.min.js"></script>
  <script src="/js/wiki_slider/jquery.liquid-slider-custom.min.js"></script>
  <script>
    $('#main-slider').liquidSlider();

    /* If you need to access the internal property or methods, use this:
    var api = $.data( $('#slider-id')[0], 'liquidSlider');
    */
  </script>
 

Attachments

The reason is probably related to your slider using fixed widths, margins and paddings. You should use a liquid (ex. using percentages) design and, if needed, you should create some media queries to hide elements from your slider in order to properly display in smaller screens.
 
If you previously touched your width on those pages check it very well. It should be working very well. or rather you might have css files on the page that are on fixed width. Make sure that you turn off your min-width and width.
 
@JulianD @Etchel You are right. Its the fixed width of my forum that prevents the slider to move into responsive desing. Had not expected.

Well, how can i change this?
In Style Properties, to get a fixed width, i have set
.pageWidth {
margin: auto;
width: 980px;
}
Should i work with "max-width"?
 
Last edited:
You can use min-width but just think how much width the user can have if he/she uses a smartphone. Usually 320px coz they still use iphone4 or lesser. but on the max-width it's up to you coz that is just the maximum width that the browser can give you.

Note: Your max-width can be your default width if your browser width is wide enough to cover it. Only use width if you want everything fixed and not responsive.
 
Top Bottom