Home › Forums › Weaver Show Posts & Show Sliders › Show Sliders Auto Sizing
- This topic has 37 replies, 2 voices, and was last updated 3 months ago by
scrambler.
-
AuthorPosts
-
June 17, 2023 at 21:15 UTC - Views: 63 #73121
GDGerlach344
ParticipantFirst of all, I’d like to thank you for your exceeding amount of patience!
Yes… text vertical centering is now working and the height of the box increases for the two line captions. The only other tweak I’d like to do is decrease the margin/padding above and below the text. Possible?
June 17, 2023 at 22:58 UTC - Views: 59 #73122scrambler
ModeratorJust add a padding property to the slider rule. The current padding is set at .8em, so if you use .4em like below it will be half.
.this-slider .atwk-caption-overlay {bottom:10px;right:auto;width:4%;padding:0.4em;}
If you want different values for top / bottom and left / right, you can use two values (first value is top/bottom, second if left/right)
.this-slider .atwk-caption-overlay {bottom:10px;right:auto;width:4%;padding:0.4em 0.8em;}
June 19, 2023 at 23:32 UTC - Views: 57 #73130GDGerlach344
ParticipantI removed the Top property and everything was perfect using these settings:
.this-slider .atwk-caption-overlay {bottom:10px;right:auto;width:4%;padding:0.3em;}
@media screen and (max-width: 580px) {
.atwkslider .atwk-caption-overlay {display:block;font-size:65% !important;}
.atwkslider .atwk-caption-overlay {right:auto;bottom:auto;width:3.97%;padding-left:5px;padding-right:10px;text-align:center;}But then… when I added an additional photo with the same 800×600 dimensions, the slider captions are no longer centered, even on my desktop. In addition to not being centered on the phone, some of text runs completely off the screen in portrait mode.
I removed the additional photo and everything looked good again, so the problem has something to do with adding photos to the gallery. I went ahead and added the photo back in so you can see for yourself what the slider captions look like.
June 20, 2023 at 01:09 UTC - Views: 50 #73133scrambler
ModeratorI told you several times that if you change the content of the slider, the width:4% will have to be adjusted.
I suspect if you have more images, the width of one will be a smaller percentage of the whole thing, so the value will have to be decreased.
Try small increments like 0.1% at a time or less
June 20, 2023 at 05:06 UTC - Views: 45 #73134GDGerlach344
ParticipantI was aware of adjusting the width when adding content but I was adjusting the width in Global CSS instead of Slider CSS. Looks fine now. Sorry about that.
What do the left-right padding values in the Global CSS affect? I tried changing the px values to see what they do but didn’t see any changes.
@media screen and (max-width: 580px) {
.atwkslider .atwk-caption-overlay {display:block;font-size:65% !important;}
.atwkslider .atwk-caption-overlay {right:auto;bottom:auto;width:4.0%;padding-left:10px;padding-right:10px;text-align:center;}June 20, 2023 at 18:22 UTC - Views: 39 #73135scrambler
ModeratorThe left and right padding will only have visible impact on phones when the caption takes the whole width of the slider area.
You had said you wanted more space on the side there.
June 20, 2023 at 19:39 UTC - Views: 35 #73136GDGerlach344
ParticipantThere are a few captions where the first line of text has only 2-3 Pixels of L-R margin pad. The picture of NBA player Andrew Wiggins is a good example. I changed both left and right padding from 10px to 20px and nothing changed. Same thing when I was incorrectly adjusting the width just to the left of the L-R padding to fix the problem I had when I added the extra photo. No matter what value I set for the width, nothing changes.
June 20, 2023 at 21:33 UTC - Views: 36 #73137scrambler
ModeratorSeveral problems.
You seem to have more rules that we discussed and some of them are conflicting with eachother.
You have a slider rule
.atwkslider-on-location .atwk-caption-overlay {
bottom: 10px;
right: auto;
width: 3.6%;
padding: 0.3em;
}That sets the global padding (all around at 0.3em) and overrides the padding set in the mobile rule below
@media screen and (max-width: 580px) {
.atwkslider .atwk-caption-overlay {
display:block;
font-size: 65% !important
}.atwkslider .atwk-caption-overlay {
right: auto;
bottom: auto;
width: 4.0%;
padding-left: 20px;
padding-right: 20px;
text-align: center
}BUT, that rule above is missing a closing Curly bracket , AND the width also need to be changed.
SO the Mobile rule above needs to become:
@media screen and (max-width: 580px) {
.atwkslider .atwk-caption-overlay {
display:block;
font-size: 65% !important
}.atwkslider .atwk-caption-overlay {
right: auto;
bottom: auto;
width: 3.1% !important;
padding-left: 20px !important;
padding-right: 20px !important;
text-align: center
}
}NOTICE the addition of !important, the different Width on mobile AND the two closing curly bracket, one for the last CSS rule and One for the @media
June 20, 2023 at 22:26 UTC - Views: 31 #73138GDGerlach344
ParticipantThe new CSS worked. Looks good. Before adding this new CSS you had me adjusting the width of the box using the Slider CSS. Now whenever I add a photo, I need to adjust the width in the Global CSS, correct? Because I noticed that changing the width in the Slider CSS no longer seems to have any affect. I have taken notes regarding how the various CSS values affect the different parameters.
BTW do I change my avatar? Couldn’t find a place to change it on my forum profile edit page.
June 20, 2023 at 22:35 UTC - Views: 28 #73139scrambler
ModeratorThe width in the SLider CSS box is global and should be set for desktop and tablet
The width in the @media rule overrides the width in the CSS slider box, but only for phones, so it needs to be changed too to make sure the width is good there too in case it needs a different value
June 28, 2023 at 13:39 UTC - Views: 22 #73152GDGerlach344
ParticipantIf I want to add additional sliders elsewhere on my website, how do I modify the Slider CSS rule and the @media rule?
June 28, 2023 at 20:15 UTC - Views: 19 #73153scrambler
ModeratorIf the other sliders needs the same changes, just add the same” .this-slider….” rule in each slider CSS rule box, and as for the @medida rule, it will apply automatically to all sliders.
If you do not want these rules to apply to other sliders, we will have to specialize the @media rule for specific sliders
June 28, 2023 at 20:38 UTC - Views: 17 #73154GDGerlach344
ParticipantIf I create additional sliders, the only difference between them will be the number of photos. So that means I’ll need to be able to adjust the width in the Slider CSS rule and the @media rule for each additional slider because the number of photos will probably vary.
June 28, 2023 at 22:45 UTC - Views: 17 #73155scrambler
ModeratorThe easiest way then will be to move the @media rule to the Slider CSS rule box.
When you remove that rule from the theme, and place it in the slider CSS rule box, you need to replace .atwkslider by .this slider like below
@media screen and (max-width: 580px) {
.this-slider .atwk-caption-overlay {
display:block;
font-size: 65% !important
}.this-slider .atwk-caption-overlay {
right: auto;
bottom: auto;
width: 3.1% !important;
padding-left: 20px !important;
padding-right: 20px !important;
text-align: center
}
}Remember all the curly brackets!!
June 29, 2023 at 16:10 UTC - Views: 14 #73156GDGerlach344
ParticipantI added the revised code in the Slider CSS box. It looks good on my desktop and good on my phone in the landscape position; however the slider doesn’t show at all when I rotate the phone to the portrait position. Here is the CSS as it appears now. The 3.49% width & 10% L-R padding settings are not new; I’ve been using those settings for about a week & the captions looked fine in portrait mode.
.this-slider .atwk-caption-overlay {bottom:10px;right:auto;width:3.78%;padding:0.3em;}
@media screen and (max-width: 580px) {
.this-slider .atwk-caption-overlay {
display:block;
font-size: 65% !important
}.this-slider .atwk-caption-overlay {
right: auto;
bottom: auto;
width: 3.49% !important;
padding-left: 10px !important;
padding-right: 10px !important;
text-align: center
}
}June 29, 2023 at 19:23 UTC - Views: 5 #73157scrambler
ModeratorI have no idea why, but you need to remove the bottom:auto. I am not sure how it ended there any way…
While at it, you can remove the right:auto, as it is already in the global rule
@media screen and (max-width: 580px) {
.this-slider .atwk-caption-overlay {
display:block;
font-size: 65% !important
}.this-slider .atwk-caption-overlay {
width: 3.49% !important;
padding-left: 10px !important;
padding-right: 10px !important;
text-align: center
}
} -
AuthorPosts
- You must be logged in to reply to this topic.