rudolfl Posted December 22, 2012 Posted December 22, 2012 Hi, all This is a general HTML question. I am working on converting my site to 2.3.3. I modified the way header is shown and I am trying to make click on the store logo to go to home page. Does not work. Here is site (test site, but running off live database, so please do not create bogus accounts, etc....) http://hatsfromoz.com.au/new_hats/catalog/index.php I wanted store image to take whole header with buttons on top, so I made store logo a background image of a header <div>. How do I make it a link to home page? Thanks, Rudolf
♥toyicebear Posted December 22, 2012 Posted December 22, 2012 Click me>> Basics for osC 2.2 Design - Basics for Design V2.3+ - Seo & Sef Url's - Meta Tags for Your osC Shop - Steps to prevent Fraud... - MS3 and Team News... - SEO, Meta Tags, SEF Urls and osCommerce - Commercial Support Inquiries - OSC 2.3+ How To To see what more i can do for you check out my profile [click here]
Juto Posted December 22, 2012 Posted December 22, 2012 This is how, with a little twist: In html <div class="div_style"><a class="link_style" href="<?php echo tep_href_link(FILENAME_DEFAULT);?>"> </a></div> In css .div_style { display:inline-block; } Style in logical ordered: .link_style,link_style:visited { /* This will be the clickable background to */ background:#ececec url('images/your_image.png') 1.25em 50% no-repeat; /* Position the image as you see fit */ } .link_style:hover, .link_style:focus { /* Style as you see fit, as per wacg */ } .link_style:active { /* Style as you see fit, as per wacg */ } Have fun. Sara Contributions: http://addons.oscommerce.com/info/8010 http://addons.oscommerce.com/info/8204 http://addons.oscommerce.com/info/8681
rudolfl Posted December 23, 2012 Author Posted December 23, 2012 Thanks, 1. Yes, i looked at Google before posting. Did not find solution that suits me. 2. Thanks, Sara. Tried your suggestion -- the problem is that only space character turns into a link. I need whole <div> to be a link. I guess, the only solution is to put image in a <div> and attach <a> to that image. The problem then is placing the buttons on it, but this should be possible with absolute position, although it will be ugly Rudolf
MrPhil Posted December 23, 2012 Posted December 23, 2012 First of all, be aware that a user clicking on this link will be exiting osC, and will lose their session (their signon and their shopping cart). If you're OK with that... If I understand what you're trying to do, you have a <div> of some size, with a background image, that you want someone to be able to click anywhere in there and go to another page? I can think of two ways, at least one mentioned before: Add a Javascript "onclick" action to the <div> and change your location. Overlay the entire <div> with a transparent image (you only need one pixel, stretch using width="100%" height="100%") and use that as the link: <div class=.....><a href="...."><img src="trans.gif" width="100%" height="100%" border="0" /></a></div> That ought to be enough to get you started.
♥mattjt83 Posted December 25, 2012 Posted December 25, 2012 With jquery: $(function(){//bof doc ready function $(".my_div_class").click(function(){ window.location = "whatever-page.php" }); });//eof doc ready function Then just make sure you add a style in your stylesheet to make the .my_div_class have a pointer cursor so people know it's a link: .my_div_class{cursor:pointer;} Matt
rudolfl Posted December 30, 2012 Author Posted December 30, 2012 Thanks! Why didn't i thought of jQuery? Got too concentrated on getting it done with CSS. Anyway, all is working http://www.hatsfromoz.com.au Thanks again and Happy New Year to everyone. Rudolf
Recommended Posts
Archived
This topic is now archived and is closed to further replies.