Results 1 to 9 of 9

Thread: [RESOLVED] Two Image Links, Side by Side; in the Same DIV

Hybrid View

  1. #1
    Join Date
    Mar 2013

    resolved [RESOLVED] Two Image Links, Side by Side; in the Same DIV

    Hey y'all,
    I am new here and new with this kind of stuff. What I've done is take a template and edit it to my specifications. I am definitely starting to get the hang of it, but still have a lot to learn. Anyway, I have one big div that needs to have 4 thumbnails in it, with descriptions below each one. I am using JAVA to make the thumbnails open a specific sized popup with a more detailed description of each car. For some reason when I inserted the java on the top two images, the right thumbnail moved over and on top of the left one. What gives? Also, I cannot get the descriptions under the right images at all. Here is my code:


    <div class="fcar"> <p><a href="javascript:;" onClick="wimpyPopPlayer('http://www.used-car-seller.com/inventory/03rendezvous.html','Auto-riffic','width=791,height=601')"><img src="images/100_2829_thumb.jpg" width="230" height="173" style="float:left" alt="" /> </a>
    <p><a href="javascript:;" onClick="wimpyPopPlayer('http://www.used-car-seller.com/inventory/02neon.html','Auto-riffic','width=791,height=601')"><img src="images/100_2838_thumb.jpg" width="230" height="173" style="float:right" alt="" /></a>

    <div class="clear"></div>

    <div class="fcar">
    <img src="images/100_2834_thumb.jpg" width="230" height="173" alt="" /><img src="images/100_2843_thumb.jpg" width="230" height="173" />

    <p><span class="headline2">1999 Ford Ranger 4x4 </span><br />
    Low mileage. Excellent warranty. <a href="#" class="a2">more...</a></p>

    <div class="clear"></div>


    #featured h2{
    background:url(../images/h_welcome.png) 0 0 no-repeat;
    #featured p{margin-bottom:10px}
    #featured p span.headline{display:block; margin-bottom:5px}
    #featured .fcar{margin-bottom:13px}
    #featured .fcar img{float:center; margin-right:13px}
    #featured .fcar p{float:left; width:114px}

    And, here is a screenshot of what is happening:

  2. #2
    Join Date
    Aug 2012
    A couple of things you might want to look at:

    1. You are using both inline and external styles so take out the inline as not required (i.e. where you have specified the floats in your image tags)
    2. There is no such thing as float:center, you can only use float left or right so that needs changing in your main CSS.

    To be able to help further, how do you want the images to appear? In a line of 4 or 2 lines of 2?

    It could help if you could link to the page you are having problems with.

    Finally, your are not using Java, you are using JavaScript - 2 completely different programming languages (just for your information).

  3. #3
    Join Date
    Mar 2013
    Jeez, I am way off. Thanks! I'm checking into what you're talking about. I'd like the images to appear in 2 rows of two, but thus far have had no luck.

  4. #4
    Join Date
    Mar 2013
    Ok, I am starting to see what you mean. I still don't understand why the images were side by side, in two rows of two but when I added the JavaScript the right image "floated" over right on top of the left one. Clearly I'm doing something wrong. And I took out the inline styles (which were only there in an attempt to fix the images after I added the javascript - I guess external trumps inline?), and am still having the same problem. The reason I was trying to use the JS was to have a defined popup window appear upon clicking on a picture of one of the cars, displaying the pertinent information about the car as well as some pics. I've been told I'm better off having this info in hidden divs that will appear upon clicking on the thumbnails, but I'm not clear on how to accomplish this. Plus, I will have up to 15 thumbnails on one page; isn't that a lot of code to put in one page? I would have to have 15 hidden divs; is this even possible?

  5. #5
    Join Date
    Mar 2013
    Yes, you are correct. My mistake. I've searched through the jquery stuff and I still can't figure it out. Here is the page with the JS on it:



  6. #6
    Join Date
    Mar 2013

    You were right about the jquery stuff, I just hadn't dug deep enough. Thanks again for all the help!!

  7. #7
    Join Date
    Aug 2012
    Using javascript to show the larger images is not a problem at all, I have no idea how having images in hidden divs would help. If the problem is only occurring when you add the javascript to the images then there may be something in the javascript function that is causing your issue and you need to look at that rather than your css.

    There are also much nicer and cleaner jquery functions to show images nowadays (in case you are not awae, jquery is a library of javascript functions) which I would recommend you look at using instead (just search for jquery image viewers or similar).

  8. #8
    Join Date
    Mar 2013
    Thanks for the quick responses!! I really appreciate it. At any rate, I believe it is something in the JavaScript that is causing this problem because previously, the images sat exactly where I wanted them to and it wasn't until I added the JS that they screwed up.
    Also, an important note: The information that I'm trying to display upon clicking on these thumbnails is more than just an image, it's a small mouseover photo gallery, info about the car, price, and a company logo. The reason I was using java was to set the size of the popup when it came up, so that people can still see the main page behind the popup with the car information. Sorry if I was vague about that before. That's why I was wondering about hidden divs, someone told me they were better than popups.
    Here is a link to the site (without the java):

  9. #9
    Join Date
    Aug 2012
    Please call it JavaScript, not Java - they really are 2 different languages Also, using jQuery for your requirements is perfect so do a search and see all the scripts available to you.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.13154 seconds
  • Memory Usage 3,171KB
  • Queries Executed 13 (?)
More Information
Template Usage (29):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (9)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (27):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./includes/functions_threadedmode.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (71):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates