-
AuthorPosts
-
September 30, 2019 at 12:25 pm #1143347
so now it works – but now you have to remove the screen rules for those sliders – because on ipad 768px no slider is seen.
the padding and navigation we will adjust after that.September 30, 2019 at 12:32 pm #1143350I purge all the caches now.
My problem is that I have too many photos on my sliders (both)
I create a test page I sent you by mail. I just left one photo one each sliders. You can test the both page with GTMetrix, the difference is important but the page is still heavy !- This reply was modified 5 years, 1 month ago by ICEMAN.
September 30, 2019 at 12:38 pm #1143357My advice : go back – and live a short while with two sliders the same time.
i will look to find a better way to have the slider on top over the header – because these shifted Containers do not belong to the header – so they do not count on main padding etc. pp.
maybe an insertBefore to a header hook would be the better way. Then the slider is part of the header.
But that needs a bit of more time. – And we had to find a way to have that depending on screen width.September 30, 2019 at 12:49 pm #1143360My logo and menu disappear since i edit the new function.
I go back and hope to find a solution. Thanks for your kindness Guenni007, it’s very nice of you to helping !- This reply was modified 5 years, 1 month ago by ICEMAN.
September 30, 2019 at 1:11 pm #1143367hm – the idea with the header hook could not work propper – because both sliders are fullwidth elements and would destroy the structure of the header.
September 30, 2019 at 3:01 pm #1143387aha – i learned something now: a cloned element is not in the DOM – so it might be possible to clone the element first – and re-add it again. My first attempt was ok. but on cloneing an element the events are lost ( known as a shallow copy ).
So we had to work with cloneNode() or importNode() – maybe a Mod knows how to clone an element including all its events.September 30, 2019 at 3:15 pm #1143390Another solution is to just use full width slider (actually on mobile version) and adapt it in order to have the same render on large screen (pc, laptop…). Actually, if I use it on large screen, the photos are enlarge and cropped. Do ou think it should be a better solution ?
But your suggestion with cloneNode() sounds good…
- This reply was modified 5 years, 1 month ago by ICEMAN.
September 30, 2019 at 5:03 pm #1143429Yes – but believe me – this will be a more academic interest now. The resulting page will be less performance then having two sliders with identical images – and setting one from them to display: none. When the images are loaded – they won’t be loaded again for the hidden slider.
please don’t make yourself a slave to such performance tools – they can’t give more than general hints. Some things make sense – others don’t.
I would optimize the pictures first in your place.you can see here my testsite : https://webers-testseite.de/guenni/two-sliders/
with one slider first.
you see that on making the screen width smaller the slider completely is out of DOM.
And making it bigger it is there again on the same place as before – but all event listeneres are gone – that is the reason why no image is seen in that slider.
So now to manually add the eventliseners again. etc. pp
with two sliders now and on resize.September 30, 2019 at 5:11 pm #1143431so my last attempt on that will be your idea here
i change now my test site.September 30, 2019 at 6:16 pm #1143460Thank Guenni007, it’s nice of you.
I know Kriesi team are working on responsive images solution.
But until the release of the update, I must find a solution to optimize my images… I don’t know good plug in for this job and I prefer not use one. I prefer manual solution in order to have maximum control of the display result. What do you think of this subject of responsive images ? What is your opinion ?September 30, 2019 at 9:03 pm #1143495so this is my last trial for now:
it only works for devices not on resize option
this is a one fullwidth-slider only on that page which has the outlook of a fullscreen-slider on desktop devices.
and if it is load on mobile devices it is a full-width slider.https://webers-testseite.de/guenni/two-sliders-2/
i gave to the fullwidth-slider the custom-class: fullscreen-onbig
there i my page id in the code – adjust it.function make_background_image(){ if ( is_page(804) ) { ?> <script> (function($){ $(document).ready(function() { var sliderLi = $('html.avia_desktop .fullscreen-onbig .avia-slideshow-inner li'); sliderLi.each(function() { var bgUrl = $(this).find('img').attr('src'); $(this).css({ 'height' : '100vh', 'background-image' : 'url('+ bgUrl +')', 'background-size': 'cover', 'background-repeat': 'no-repeat', 'background-position': 'center center', }); $(this).find('img').detach(); }); }); })(jQuery); </script> <?php } } add_action('wp_footer', 'make_background_image');
September 30, 2019 at 9:29 pm #1143498and by the way – the solution with two sliders set one on display none : https://webers-testseite.de/guenni/two-sliders-3/
https://gtmetrix.com/reports/webers-testseite.de/srn0Z281
this page has a better performance than the other!September 30, 2019 at 9:29 pm #1143499Guenni007, you work too much !
It is past 9 p.m. !I add your function and It works well but on large screen , the height of the slider is not the same as fullscreen slider.
I create a new page test in order to show you the result. Change the url of my test page by replacing “test” by “test-2” at the end of the url.But do not look tonight, it’s late ! Take advantage of your evening !
We will take a look tomorrow if you want.
Thank you again for your kindness and your precious help.Good night Guenni007 !
October 8, 2019 at 3:00 pm #1146184this is for your problem the best construction.
Take only a fullscreen slider – set its screenoptions to display everywhere !!!:https://webers-testseite.de/slider-depending-on-screenwidth/
there is even for you a better moving script for the slider before the header container with a little performance optimizing debounce function.
Enfold itself has a debounce function included but i didn’t know how to use it for this function.October 8, 2019 at 3:31 pm #1146194October 8, 2019 at 5:43 pm #1146229You are right Guenni, it is better to keep full screen slider. Maybe the solution is to put fullscreen slider in a container and so, resize it to have smaller images (for example 500px x 334px) , in that way, images are ok for all screen sizes.
I don’t know if its possible to contain fullscreen slider in a container…October 8, 2019 at 8:42 pm #1146271no one hampers you to calculate other width: f.e.
for my example page:
because it is a grid-row after the slider the calculation it a bit different from color-section as follower.@media only screen and (max-width:989px) { #united_slider .avia-slideshow.av_fullscreen { width: calc(100vw - 16%) !important; height: 45vw !important; left: 50%; transform: translateX(-50%); } }
October 9, 2019 at 12:25 pm #1146492Hi Guenni, I test your testimonial-styling, you can see the result, it’s works perfectly and it’s beautiful.
Like I said to you yesterday, I am looking to test for a smaller fullscreen slider which would allow to use smaller photos and so, make the loading time shorter. I have to find a nice layout.
What do you think about this idea ? In that way, I can keep the slider.Otherwise, I have to replace the slider with a responsive mosaic of photos with a fixed height ( like fullscreen slider).
I will end the slider so that the site is operational and efficient and after I will work on the idea of the mosaic to perform performance tests
- This reply was modified 5 years, 1 month ago by ICEMAN.
October 9, 2019 at 1:54 pm #1146517Guenni, I test your solution (paste /aa-test-2/ ) after my home link to access my test page.
As you can see, the GTMetrix test is less good. Total page size up to 5.46 mo against 3.66Mo on actual home and the loading time is 5.6s against actual 3.3s. I don’t understand why…So actual 2 sliders is lighter than just 1 slider…. I don’t understand why…
October 9, 2019 at 2:40 pm #1146522If you do that all testings : do you allways refresh all caching tools ( including autoptimizer , enfold merging etc.) ?
October 9, 2019 at 2:54 pm #1146527yes absolutely, I refreshed all caching and auptimizer
October 15, 2019 at 7:59 am #1147981 -
AuthorPosts
- The topic ‘Full screen slider display’ is closed to new replies.