Mak­ing it work on mo­bile

Web Designer - - Tutorials -

You may be won­der­ing ex­actly how this works on a mo­bile or tablet de­vice, given that there is no mouse to rollover the im­age. In step 14 the ‘en­able­touch’ op­tion is set to true; do this on all images that you want to work on mo­bile.

The way it works is that to en­able scrolling when the user flicks, there is a thresh­old that it will wait for be­fore trig­ger­ing the an­i­ma­tion. The de­fault is

250 mil­lisec­onds, so when a long press is de­tected the an­i­ma­tion will hap­pen. That’s the first part. If this is a link then the user needs to be taken to a link. Tap­ping a sec­ond time will fire the link and thus take the user to a new page. Be­cause Di­rec­tion-re­veal has thought about the us­abil­ity of some­thing like this, it makes it sim­ple to work with.

Newspapers in English

Newspapers from UK

© PressReader. All rights reserved.