Comments (4)
Yes, the code that runs when you call the plugin just initializes the plugin and there is currently no concept of uninitializing and/or reinitializing that is implemented. However, this does seem like this would be a good component of functionality to have so I will keep this item open for a possible future implementation. I do not have a specific timeline for this at the moment, however.
from flexisel.
Okay, thanks... From an application stand point this is what I was trying to accomplish:
For desktop users (and possible tablets) there would a 100% spanning DIV on the bottom of the page with the scrolling items (2-4 items displaying based on browser width).
For tablet/mobile users the DIV would get resized to be 25% and be floated up and to the right of another DIV. In this view we would only be displaying 1 item and scroll through the rest.
Currently I am using a mixture of media quires with combinations of height and width to change the display around. I'm trying to think of a work around with external script sheets and AJAX calls where I have two variations of the flexisel... one for a large height, and another for a smaller height... but I am not sure if this would even work, any thoughts?
from flexisel.
Just curious, it's almost 11 months later. Any updates?
from flexisel.
Hi again. Sorry for the delay in response here. Because it has been awhile and no one had submitted any PR's for this functionality I have thought about this a bit and here something you could do to reinitialize the plugin based on some external logic... Because the resize event in jQuery (used by the plugin) is actually different than the native JavaScript one you could utilize the native resize event which would not be impacted by the plugin's jQuery resize event. You could first wrap the initial unordered list in some element like so...
<div id="container">
<ul id="flexiselDemo1">
<li><img src="images/logo-nyt.png" /></li>
<li><img src="images/logo-microsoft.png" /></li>
<li><img src="images/logo-ebay.png" /></li>
<li><img src="images/logo-hp.png" /></li>
<li><img src="images/logo-youtube.png" /></li>
</ul>
</div>
Then you could cache the original content in a variable external to the plugin and add a native JavaScript resize event listener/timeout. When that event fires you could clear out the container, repopulate it with the cache, and then reinitialize the plugin with the different breakpoints depending on whatever logic you were using to determine it. It would end up looking something like what is shown below. It's not pretty, but it would probably do what you are wanting to accomplish.
$(window).load(function() {
var cache = document.getElementById("flexiselDemo1").outerHTML;
$("#flexiselDemo1").flexisel();
window.addEventListener("resize", reinitialize, false);
var resizeTimeout;
function reinitialize() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
$("#container").empty();
$("#container").html(cache);
$("#flexiselDemo1").flexisel({
// reinitialize with different settings based on some logic somewhere
});
}, 500);
}
});
Because this is a somewhat unconventional approach, I don't think we would officially support it... but hopefully that will at least allow you to grok together something based on your own requirements. Because it is unlikely that there will be any future efforts made for these sorts of scenarios, I am going to close this issue out for the time being.
from flexisel.
Related Issues (20)
- - increment margin between items HOT 2
- Element order when set infinitely:true HOT 4
- Slides. second item overlaps with previous and next one HOT 2
- Need to trigger methods.scroll(true); from page on mouseover event. HOT 1
- Dynamic Data Binding HOT 1
- visibleItem:1 is not working properly HOT 2
- Can this flexisel compatible with ie8 HOT 2
- Can we turn off slider on small widths HOT 3
- swipe is left or right? HOT 1
- Event Propagation HOT 1
- How to disable touch swipe HOT 1
- When autoplay is enabled, DOM gets bombarded with duplicate clones. HOT 3
- How install in angualr js..? HOT 2
- Disable next button condition HOT 1
- Add bullets pagination HOT 1
- Needs a up/down carousal animation HOT 1
- Pause Slider until it's visible in the viewport
- For many picture norounded value problem solved liked below
- Not working with latest jquery version 3.x HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flexisel.