Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

$4.95 Windows Hosting at Webhost4life.com
  Ads  
r2i.ntegrated
 


  Sponsors  

Meet Our Sponsors

MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Make it Hot! ( ...  rollover images/menus - possible to incorporate into a skin?
Previous Previous
 
Next Next
New Post 4/2/2006 2:25 PM
User is offline John Mitchell
3868 posts
www.snapsis.com
4th Ranked




Re: rollover images/menus - possible to incorporate into a skin? 

Cool, I wouldn't mind at all if you decided to my CSS Menu

But if you want to use the built-in SolPart menu and are not worried about modifying the JS a little, then look for spmenu.js in the controls\solpartmenu folder of your dnn installation.

In that file go to line 571(may be alittle different depending on DNN version) and you will find the event that handles a mouseover for the menu bar called       SolpartMenu.prototype.onMBMO

In this event, I would just add a line to change the CSS class of the html element that holds your images above the menu.

  document.getElementById("MENU_IMG").className= 'MENU_IMG_' +oCell.innerText; //the innerText of the Cell is the name of the tab

And in your CSS you would have

.MENU_IMG_Home {
   background:url(MenuHome.gif);
}

.MENU_IMG_News {
   background:url(MenuNews.gif);
}


 
New Post 4/2/2006 3:16 PM
User is offline John Mitchell
3868 posts
www.snapsis.com
4th Ranked




Re: rollover images/menus - possible to incorporate into a skin? 

BTW, this will change the behaviour of all your portals in that DNN instance, so if you have more portals running off that same instance then you may want to work it so that this change only gets applied when you have a specific skin installed.

As a matter of fact, it would be good to do it this way anyway, so that you aren't changing a core file that will be written over if/when you upgrade.

Here is an easy way to override that function in the JS for just the skin that you want to apply this to.

Copy the entire function into a new .js file (let's call it MenuImg.js) and put that file in your skin's folder.

Then in your skin, put a reference to the MenuImg.js file.  Now this MenuImg.js file will get loaded after the spmenu.js file, but only when using this skin, and since it has a function in it with the same name, this one will be used instead of the orginal (this is because of how JS is loaded into the DOM).

Oh, and I found that there is an extra space in the test of the TD cell that holds the tabname, so change the line I posted earlier to:

     document.getElementById("MENU_IMG").className= 'MENU_IMG_' + oCell.innerText.replace(/^\s*|\s*$/g,""); //the innerText of the Cell is the name of the tab

I have worked this up as an example with the core DNN-Blue skin.

If anyone wants me to make it available for download just let me know.


 
New Post 4/3/2006 12:43 PM
User is offline zeke woollett
26 posts
10th Ranked


Re: rollover images/menus - possible to incorporate into a skin? 

John,

You 'da man! This is exactly what we're trying to do-many thanks! If you'd like to make it available for dowload that would be great.

 
New Post 4/4/2006 10:26 PM
User is offline Ferd Biffle
8 posts
10th Ranked


Re: rollover images/menus - possible to incorporate into a skin? 

If I'm following this thread correctly, I have implemented the same effect by adding the following code to the dnncore.js

/*************************************************************************
  This code is from Dynamic Web Coding at
http://www.dyn-web.com/
  Copyright 2003 by Sharon Paine
  See Terms of Use at
http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

/* 
    dw_layer.js
    a few commonly-used functions for handling positioned divs
    used by Writing to Layers examples at
www.dyn-web.com 
*/

layerHandler = {
  getRefs: function (id) {
    var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
    if (el) el.css = el.style? el.style: el;
    return el;
  },
 
  writeLayer: function (el, cntnt) {
    if (typeof el.innerHTML!="undefined") {
        el.innerHTML = cntnt;
    } else if (document.layers) {
     el.document.write(cntnt);
     el.document.close();
    }
  },
 
  shiftTo: function (el,x,y) {
    var px = (document.layers || window.opera)? 0: "px";
    if (x != null) el.css.left = x + px;
    if (y != null) el.css.top = y + px;
  },

  show: function (el) { el.css.visibility = "visible"; },
  hide: function (el) { el.css.visibility = "hidden"; }
}

var imageHandler = {
  imgs: [], path: "",
  preload: function() {
    for (var i=0; arguments[i]; i++) {
      var img = new Image(); img.src = this.path + arguments[i];
      this.imgs[this.imgs.length] = img;
    }
  }
}

// returns amount of vertical scroll
function getScrollY() {
 var sy = 0;
 if (document.documentElement && document.documentElement.scrollTop)
  sy = document.documentElement.scrollTop;
 else if (document.body && document.body.scrollTop)
  sy = document.body.scrollTop;
 else if (window.pageYOffset)
  sy = window.pageYOffset;
 else if (window.scrollY)
  sy = window.scrollY;
 return sy;
}

// returns amount of horizontal scroll
function getScrollX() {
 var sx = 0;
 if (document.documentElement && document.documentElement.scrollLeft)
  sx = document.documentElement.scrollLeft;
 else if (document.body && document.body.scrollLeft)
  sx = document.body.scrollLeft;
 else if (window.pageXOffset)
  sx = window.pageXOffset;
 else if (window.scrollX)
  sx = window.scrollX;
 return sx;
}

// resize fix for ns4
var origWidth, origHeight;
if (document.layers) {
 origWidth = window.innerWidth; origHeight = window.innerHeight;
 window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

// preload images to be written to layer

// Customized links to the desired on/off images here...

imageHandler.preload("http://localhost/images/Video.gif","http://localhost/images/Business.gif","http://localhost/images/Classifieds.gif","http://localhost/images/Events.gif","http://localhost/images/AdCalls.gif","http://localhost/images/Blog.gif");
// content to be written to infoDiv onmouseover of links
var LinkText1 = '<img src="
http://localhost/images/Video.gif" width="121" height="23" alt="" border="0">';
var LinkText2 = '<img src="
http://localhost/images/Business.gif" width="191" height="23" alt="" border="0">';
var LinkText3 = '<img src="
http://localhost/images/Classifieds.gif" width="221" height="23" alt="" border="0">';
var LinkText4 = '<img src="
http://localhost/images/Events.gif" width="147" height="23" alt="" border="0">';
var LinkText5 = '<img src="
http://localhost/images/AdCalls.gif" width="152" height="24" alt="" border="0">';
var LinkText6 = '<img src="
http://localhost/images/Blog.gif" width="90" height="28" alt="" border="0">';
var page_loaded; // set true onload
function doFlexTip(id,e,sHTML,offBtnTop,offBtnLft) {

  var el = layerHandler.getRefs(id);

  if (!el) return;
  layerHandler.hide(el); // just in case ...
  var cntnt = '<div class="info">' + sHTML + '</div>';

  // get position of onmouseover event and use it to position layer 
 e = (window.event)? window.event: e;
 if (e) {
 var n = LinkElement(e);
 var btnLeft = GetElementLeft(n);
 var btnTop = GetElementTop(n);
 var x =  btnLeft-offBtnLft;
 var y =  btnTop+offBtnTop;
 layerHandler.shiftTo(el, x, y);
 }
   layerHandler.writeLayer(el, cntnt);
   layerHandler.show(el);
 }
 
function hideFlexTip(id) {
 
  var el = layerHandler.getRefs(id);
  if (!el) return;
  layerHandler.hide(el);
}
Then in the skin ascx file, add the js function call on the rollover point. Note DHTML positioning:

Sample:

<TD>
   <a href="
http://localhost/cabovideonet/CaboChat/tabid/60/Default.aspx" onmouseover="image6.src='<%= SkinPath %>images/newCaboSkin_20b.jpg';doFlexTip('infoDiv',event,LinkText6,63,16)"
onmouseout="image6.src='<%= SkinPath %>images/newCaboSkin_20.jpg';;hideFlexTip('infoDiv')">
<img name="image6" src="<%= SkinPath %>images/newCaboSkin_20.jpg" border=0></a></TD>

Finally, just add the div at the bottom of your ascx file.

 </TR>
<DIV id="infoDiv" class="infoDiv"></Div>
</TABLE>
</Body>

Took awhile to get it right, but it works pretty slick...

http://67.165.200.57/cabovideonet

Hope that helps!

Eric

 
New Post 4/6/2006 4:23 PM
User is offline zeke woollett
26 posts
10th Ranked


Re: rollover images/menus - possible to incorporate into a skin? 

Eric,

Looks great! Not exactly what we're trying to accomplish (we are incorporating into the solpart menu at the top), but this certainly sparks some ideas-thanks for the detailed post, we'll definately play with this!

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Make it Hot! ( ...  rollover images/menus - possible to incorporate into a skin?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Faculty of Graduate and Postdoctoral Studies
At the graduate level, the University of Ottawa offers more than 180 graduate certificates, master's degrees and PhDs, as well as interdisciplinary programs such as Women's Studies and Canadian Studies. Many postdoctoral opportunities are available in both the sciences and the humanities. For further information, please consult the site of the Faculty of Graduate and Postdoctoral Studies.
www.grad.uottawa.ca
Vekkin Solutions
Vekkin Solutions provides complete website solutions and custom module development to churches and small businesses.
www.vekkin.com
Powered by Adcuent®.Com
Adcuent® Consulting & Technology offers custom development web applications and hosting projects under the brand of Powered by Adcuent®.Com
www.adcuent.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP