• Resolved macart

    (@macart)


    I would like an image to load into “contentBanner” when home or blog is clicked. Can I somehow do a call in my secondaryNav to load an image into contentBanner?

    <div class=”secondaryNav”>


    </div>
    <div id=”contentBanner”></div>

    #contentBanner {
    height: 250px;
    width: 788px;
    float: left;
    background-image: url(images/home.jpg) !important;
    margin-top: 10px;
    margin-bottom: 20px;

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter macart

    (@macart)

    Sorry somehow my code was lost in the first post

    <div class=”secondaryNav”>


    </div>
    <div id=”contentBanner”></div>

    #contentBanner {
    height: 250px;
    width: 788px;
    float: left;
    background-image: url(images/home.jpg) !important;
    margin-top: 10px;
    margin-bottom: 20px;

    Thread Starter macart

    (@macart)

    Sorry lets try this again.

    <div class="secondaryNav">
    <a id="home" href="mysite/wordpress/home" title="home"></a>
    <a id="blog" href="mysite/wordpress/blog" title="blog"></a>
    </div>
    <div id="contentBanner"></div>

    Thread Starter macart

    (@macart)

    My web search found this, but not sure how to properly write the function for wordpress. Will this work in WordPress?

    <script type="text/javascript">
    function changeIt(imageName,objName)
    {
    	var obj = document.getElementById(objName);
    
    	var imgTag = "<img src='"+imageName+"' border='0' />";
    
    	obj.innerHTML = imgTag;
    
    	return;
    }
    </script>
    </head>
    
    <body>
    <div id="image1">
    <img src="1.jpg" border="0" alt="one" />
    </div>
    
    <br /><br />
    
    <a id="one" href="#" onclick="changeIt('1.jpg','image1');">one</a>
    <a id="two" href="#" onclick="changeIt('2.jpg','image1');">two</a>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Load Image in Div’ is closed to new replies.