How to add image to QTextBrowser using Python?

How do you add image gallery slider on website using CSS instead of JavaScript?

  • I want to remove scripts altogether from my webpages and image slider is one of the biggest issue when it comes to site speed optimization. If you could help me to remove js from Tabs and Contact form as in datepicker.js etc.,  I'd be really grateful. Thanks

  • Answer:

    Hi, I've been designing without JS for 3 years now, and I'm happy I made that decision. I still use JS for some tasks like watching events or enabling HTML5 elements in old IE. There are many techniques to achieve an image slider in CSS. You can play with @keyframe or :target. It depends on your target (pun not intended) audience and if they use modern browsers. I would say that :target is a safer option. You can check an example made by Deaxon: http://playground.deaxon.com/css/sliding-image-gallery/#1 There are other examples in his CSS playground: http://playground.deaxon.com/css/ You've also asked about datepicker.js. It is useful for older browsers. Modern browsers have built-in calendars, all you need is to use proper html5 forms: http://diveintohtml5.info/forms.html Tabs are also easily replaced by :target, however, keep in mind that too many elements relying on the :target on one page will interfere with each other. I would recommend using JS if this is a case. Remember that you don't have to rely on JS libraries. Many tasks can be achieved by a few lines of simple JS that will not slow your website significantly. On the other hand, some of the fastest websites rely heavily on JS.

Marcin Retecki at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.