load js or php based on users screen size

后端 未结 4 549
刺人心
刺人心 2020-12-19 14:36

I have a couple of Swiffy (HTML5 SWF) animations which i only want to be loaded based on the users screen size!

iv found some JavaScript below which says it will loa

4条回答
  •  抹茶落季
    2020-12-19 15:25

    The contents of those php files will be injected into the JavaScript literal and could possibly break the literal. Could you post the resultant html when viewed from a browser.

    Possibly what you want to do is put both php files into the code in seperate divs and then use CSS to hide or display the relevant one.

    If you do this you could use @media css queries to display/hide the sections based on window size and this would dynamically adjust as the user resizes the browsers.

提交回复
热议问题