We are working on a mobile web application. The designer likes the image carousel effect on App Store (the screenshots of the an App). So we try to mimic the same effect using JavaScript.
We are using iScroll to implement. So here is a customization of its demo carousel: http://jsfiddle.net/0t9savgj/. The options are:
{
scrollX: true,
scrollY: false,
momentum: false,
snap: true,
snapSpeed: 400,
keyBindings: true,
indicators: {
el: document.getElementById('indicator'),
resize: false
}
});
The problem is: for the last image, there is always some extra space, which is unwanted:
Does any one knows how to solve this? Or some other JS libraries implementing the same carousel? Thanks.
After exploration, the only way is to use the scroll event of iscroll-probe.js. Manually stop the scrolling when reaching the right border. But the indicators are not exact.
Related
So my custom loader is not loading instantly only like a split second then it loads here is my site, my goals is to my custom components load. PS when i change ssr to false it works
here is my site: https://micahkwaka.dev
export default {
loading: '~/components/LoadingBar.vue',
loadingIndicator: false,
ssr: true,
pageTransition: {
name: 'my-page',
mode: 'out-in'
},
// Target (https://go.nuxtjs.dev/config-target)
target: 'static',
}
EDIT: This loader is when you have an SPA, to wait for it to load before showing the content. Since you're using Nuxt as an universal app (ssr + client), you will have the static content first (before the JS kicks in, and therefore your animation). So, you could make one with static SVG/CSS but the backed-in JS loader is not the solution here.
The best way would be to disable the JS to test the final result. Still, I'm pretty sure that Google will give you a better rating if you do not have any loader. You could maybe add it to your page transitions tho.
For the animation itself, start with it, then setTimeout the removal of it after 500ms or alike. Plenty ways of doing it. But you will need to have it on the initial render of your page (before the JS hydration).
Why do you set the loadingIndicator to false if you want it ?
If you want a custom one, provide a path to key as explained in the documentation: https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-loading-indicator/
Is there any reason why my chart legends are always appearing on the right? My config looks like this:
legend: {
enabled: true,
position: 'bottom'
}
Setting enabled to false causes the legend to disappear as expected, but changing the position has no effect.
This is using #gooddata/react-components 5.2.0-alpha17
The config looks correct. Please share the code for the whole component and we will have a look at it. This is unlikely the problem, but please try to use a stable version instead of alpha. Current stable version is 5.1.0.
Please check you are importing your styles correctly
import '#gooddata/react-components/styles/css/main.css';
This snippet should work:
<PieChart
projectId={projectId}
measures={measures}
config={{
legend: {
enabled: true,
position: 'bottom'
}
}}
/>
You can find more information about chart legends in the official documentation
I tried this simple example:
$.magnificPopup.open({
gallery: {
enabled: true
},
items: [
{src: "tracks/" + p[0]},
{src: "tracks/" + p[1]}
],
type: 'image'
});
Only the first slide (0) pops up and there is no gallery - just a single slide. What is wrong?
You should never give up: Problem is solved. I isolated the code from the gallery example of the homepage of Magnific Popup and put it into a page of my own. The result was the same as described above i.e. gallery was not working. I then downloaded Magnific Popup again and noticed that the library file was bigger than my previous library file. So the library file was corrupted in some way - probably my fault. Now gallery is working...
I'm using flexslider in my website, all slides have you-tube content and some text,
all browsers works great with my slider, but i'm having a weird problem in safari.
the problem is, that all you-tube's content are shown (without the text) although, they are not the active slide.
a little bit of explanation:
I mean that when the slider is shown, I can see the current you-tube, in the middle (the active slide) and also the previous and the next you-tube in the left and the right side.
I have tried to look for any kind of solution to this problem, but with no success.
my slider configuration:
$('#contentSlider').flexslider({
animation: "slide",
slideshow: false,
controlNav: false,
directionNav: false,
animationLoop: true,
video:true,
controlsContainer: ".sliderContainer",
before: window.ozcode.carouselManager.beforeSlide,
after: window.ozcode.carouselManager.afterSlide,
});
Thanks,
NadavSt.
I am trying to take a picture using camera in Sencha Touch 2. Here i have one button 'Take a Picture', when i will press it, camera should start. As i am new to this sencha touch 2, i am unable to figure it out, how to do this?
For this i used the below code:
Sencha Fiddle Link
Please help me. I do not want to use Phone gap.
You have to add device folder of Sencha Library in root directory
and add below code in
Ext.require('Ext.device.Camera');
and use this code for capture image using camera
Ext.device.Camera.capture({
success: function(image) {
imageView.setSrc(image);
},
quality: 75,
width: 200,
height: 200,
destination: 'data'
});
If you want to use purely sencha, then you can check this code:
xtype: 'button',
handler: function(button, event) {
Ext.device.Camera.capture({
source: 'camera',
destination: 'data',
success: function(imagedata) {
var img = Ext.getCmp('theimage');
img.setSrc('data:image/jpeg;base64,' +imagedata);
},
failure: function() {
Ext.Msg.alert('Error', 'There was an error when acquiring the picture.');
},
scope: this
});
But if you want to use phonegap camera features, may be you have to change the code. As sencha is giving the default feature to handle the camera, i wish not to go with phonegap. Hope it will help..