![]() |
Change Header Depending to Screen Size
Hello,
I designed a header for 1280 and above screen width. But when screen width is below than 1280 pixels, it doesn't look well. So I want to change header depending to user's screen width. I tried something like that in header template, but it didn't work: <vb:if condition="screen.width <= '1280'"> Header code for above 1280px </else> Header code for below 1280px </vb:if> Where I am mistaken? |
Quote:
is: <vb:else /> and not </else> Edited: But I've doubts for your condition. Where did you found that screen.width . If it's a global variable you must use the sign $ before. eg: $screen.width Chris |
Oh, that's right, I'll try it. Thank you Chris!
By the way, after asked this question I managed to do it with iframe like this: Code:
<script type="text/javascript"> |
Also change $screen.width <= '1280' to screen.width <= 1280
|
Dear Chris,
Where to put that code inside headinclude template in your following solution: (I mean at the end or at the beginning of code) https://vborg.vbsupport.ru/showpost....82&postcount=8 --------------- Added [DATE]1365532959[/DATE] at [TIME]1365532959[/TIME] --------------- Quote:
Thank you Chris! In order to help people who will find this page via search engines for same intention I share the code: Code:
<vb:if condition="screen.width <= 1280"> |
Thank you so much for this thread. I am trying to do something similar.
I created a plugin that hooks into global_setup_complete and determines when to show a second advertisement on my forum to a guest visitor. Currently it is setup to only show a second advert if the user is not using a tablet or a phone to view the page. I would also like to add the check for screen width at the plugin level. I have the following code: Code:
global $vbulletin, $show; Thank you! |
All times are GMT. The time now is 11:47 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|