Coder Social home page Coder Social logo

Auto height with content slider. about slider HOT 4 CLOSED

jssor avatar jssor commented on August 15, 2024
Auto height with content slider.

from slider.

Comments (4)

jssor avatar jssor commented on August 15, 2024

thanks for your interest.
ok, let me add one more template (auto fit height to its parent container) later.
The way to make it is as follows,
#1. create a parent container like <div style="padding: 0px; height: 100%></div>
#2. place jssor slider in the parent container.
#3. when window resize, retrieve height of the parent container, calculate the exact width and height the slider should be.
var parentHeight = slider_instance.$Elmt.parentNode.clientHeight;
var sliderOriginalWidth = slider_instance.$GetOriginalWidth();
var sliderOriginalHeight = slider_Instance.$GetOriginalHeight();
var newWidthToFitParentContainer = parentHeight / sliderOriginalHeight * sliderOriginalWidth;
slider_instance.$SetScaleWidth(newWidthToFitParentContainer);
#4. center the slider to parent container.
var parentWidth = slider_instance.$Elmt.parentNode.clientWidth;
$JssorUtils$.$SetStyleLeft(slider_instance.$Elmt, (parenWidth - newWidthToFitParentContainer) / 2);

Regards,
Jssor

from slider.

sameh-serag avatar sameh-serag commented on August 15, 2024

I tried it with http://www.jssor.com/demos/full-width-slider.html
but it's seems there is something missing ..... it doesn't work for me

from slider.

jssor avatar jssor commented on August 15, 2024

please send me your work http://www.jssor.com/support.html

from slider.

jssor avatar jssor commented on August 15, 2024

please use api call, see reference
http://stackoverflow.com/questions/23350831/jssor-full-height-or-full-screen-slider-possible

from slider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.