Nobody knows this? I have tested allthe stuff I can think of but it won't work.
How can I center an image inside the sliderframe?
Nobody knows this? I have tested allthe stuff I can think of but it won't work.
I didn't try. But I think CSS can help. The image you see is actually the DIV's background image, so you can use the background-position to center the image. Maybe you also need to use !important declaration to overwrite its default style settings. For example: background-position:center center!important.
You can also consider Ninja Slider that has more flexibility for developers.
Is it here? Or where is it. I have tride on othere places but it won't work.
#slider img {
......
background-position:center center!important;
.......
}
No. If you know how to use Chrome developer tool, you can view the slider's markup in the Elements panel of the Chrome developer tool, and you will find the following element:
<div id="slider">
<img ... />
<img ... />
<img ... />
<div class="sliderInner">
<div class="mcSlc" style="background: url("/slider/jsImgSlider/images/image-slider-4.jpg") 0px 0% no-repeat;"></div>
</div>
</div>
So you can try adding the style to override the javascript generated style (0px 0% no-repeat):
#slider div.mcSlc {background-position:center center!important;}
Hi Peter.
Thank you so mutch for the help.
It did work. But it starts at the left then when the image change to another it "jumps" to center. Do you know a workaround for that so it starts always at the center?
Please go to http://www.menucool.com/javascript-image-slider#view2, and you will find this instruction:
Make the slider the same size as your images. For example:#slider { width:960px;height:420px; }
If you are using Javascript Image Slider you have to keep the slider the same size as your images.
If you prefer responsive slider that can change its sizes according to the window size, you are recommended to use the Ninja Slider.
Thanks Peter for the advise.
If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;
If your question is related to the Javascript Image Slider, click:
Ask new question: Javascript Image SliderOtherwise navigate to one of the following forum categories, and post your question there.
##