Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Design and Graphics Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-05-2014, 10:27 PM
afmarko99's Avatar
afmarko99 afmarko99 is offline
 
Join Date: Jan 2007
Location: Louisiana
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How-To: Fix header image on phones & ipad *Help pls*

All,

I have my forum setup perfectly for the PC with maxwidth at 1125 and auto margins. However, when I visit the forums on my phone or my ipad the banner extends beyond the width of the forum.

Please see this link for the reference image.

Forum of reference: http://forum.withwingslikeeagles.net/
Reply With Quote
  #2  
Old 04-07-2014, 07:39 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's because the header image if HUUUUUUUUGE @ 1125px x 233px.

I would take a hint from "responsive" web design and use @ media screen css example:

Code:
@media screen and (min-width: 1125px) {
     .logo-image {
background: transparent url(images/misc/bannergraphic_photoshop.png);
     }
}
Code:
@media screen and (max-width: 1124px) {
     .logo-image {
background: transparent url(images/misc/bannergraphic_photoshop_small.png);
     }
}
Try that in additional.css but change the bannergraphic_photoshop_small to your image smaller logo image needs to be a smaller shrunk down version of your logo i.e. less text etc perhaps just icon/logo only so that way when it resizes your logo is not larger than the content.

I'm actually working on a responsive style now and its giving me some issues on subsequent pages but that should work let me know if not.
Reply With Quote
2 благодарности(ей) от:
Max Taxable, RichieBoy67
  #3  
Old 04-08-2014, 01:55 AM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did this, for mobile but works great for regular styles as well. Single image, scaling header:

In header template put:
HTML Code:
<a name="top"></a>
<td valign="top" style="padding: 0pt;"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<td align="center"><a href="./"><img class="imageObject" alt="Your Forum Name" src="http://yoursite.com/images/misc/yourbannerimage.jpg" width="100%" height="100%" border="0" align="center" /></TD></table>
Then in extra CSS attributes, define the img class for IE compliance: (This is a MUST.)

.imageObject {
max-width: 100%;
}

This insures the single header image will scale both in width and height and keep perspective.

Examples where I have implemented this:

MLB Fan Forum - Powered by Baseball Fans

The Dallas Cowboys Forums - Dallas Cowboys Fan Forum Mobile Style

US Messageboards - Opinion, News and Information

You can see the header image on those sites adjusts to your browser width. As you make it skinny, or wide, it moves like a 3 piece header would but it is just one image that scales. (However this is impossible to accomplish for chrome and safari, they ignore the 'max-width' definition.)

BEST RESULTS: Make your banner image at least twice as wide as the widest mobile resolution you would encounter (maybe 700px wide by whatever the height is) so that you are always only scaling down, not up. For better quality.
Reply With Quote
  #4  
Old 04-08-2014, 10:28 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But you realize that using tables for layout purposes is not what tables are meant for, and it's not good practice to do that? This has been done 10 years ago, but Webdesign has moved on since then...

Also, your syntax is completely messed up: td - table - td - /td - /table, where it should be table - tr - td - /td - /tr - /table.

And what exactly do you need the table for at all? Setting the img-width to 100% will achieve exactly the same.
Reply With Quote
Благодарность от:
Max Taxable
  #5  
Old 04-08-2014, 07:22 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cellarius View Post
But you realize that using tables for layout purposes is not what tables are meant for, and it's not good practice to do that? This has been done 10 years ago, but Webdesign has moved on since then...

Also, your syntax is completely messed up: td - table - td - /td - /table, where it should be table - tr - td - /td - /tr - /table.

And what exactly do you need the table for at all? Setting the img-width to 100% will achieve exactly the same.
Might be exactly why sometimes IE blows the image way up!
Reply With Quote
  #6  
Old 04-09-2014, 11:51 PM
afmarko99's Avatar
afmarko99 afmarko99 is offline
 
Join Date: Jan 2007
Location: Louisiana
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TheLastSuperman View Post
That's because the header image if HUUUUUUUUGE @ 1125px x 233px.

I would take a hint from "responsive" web design and use @ media screen css example:

Code:
@media screen and (min-width: 1125px) {
     .logo-image {
background: transparent url(images/misc/bannergraphic_photoshop.png);
     }
}
Code:
@media screen and (max-width: 1124px) {
     .logo-image {
background: transparent url(images/misc/bannergraphic_photoshop_small.png);
     }
}
Try that in additional.css but change the bannergraphic_photoshop_small to your image smaller logo image needs to be a smaller shrunk down version of your logo i.e. less text etc perhaps just icon/logo only so that way when it resizes your logo is not larger than the content.

I'm actually working on a responsive style now and its giving me some issues on subsequent pages but that should work let me know if not.
So basically I need to create a smaller image for it to pull on mobile and then add both of those codes into additional.css?

Thanks
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:43 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03844 seconds
  • Memory Usage 2,232KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (1)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (3)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete