Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...trying to call a javascript function from xslt.......trying to call a javascript function from xslt.......
Previous
 
Next
New Post
7/12/2009 9:43 PM
 

i have an xslt file and i need to call a javascript function to reset the left position of some images. but i can't figure out how to call the javascript function.

i have this DIV:

<div id='{$pProductID}' style='display: none; position: absolute; left: 60px; top: 115px; border: solid black 1px; padding: 10px; background-color: rgb(255,255,225); text-align: justify; font-size: 12px; width: 225px; float: left;'>

what i'd LIKE to do, is call a javascript function in place of the hard coded "left: 60px;"

in my xslt file i can create a link and have it call a javascript. the javascript is designed to alert out the x-position of the mouse cursor. i took this code off of the internet and it works. but using it on the xslt page doesn't work. i can see that the function is being called because i have an initial alert. but nothing happens after that. here is my script:

first alert fires - alerts hi1 and hi2 do not and no error is generated:

<script type="text/javascript">
function getmouseposition(e) {
hi");
    var posx = 0;
    var posy = 0;
    if (!e) var e = window.event;
    if (e.pageX || e.pageY)     {
hi1");
        posx = e.pageX;
        posy = e.pageY;
    }
    else if (e.clientX || e.clientY)     {
  hi2");

        posx = e.clientX + document.body.scrollLeft
            + document.documentElement.scrollLeft;
        posy = e.clientY + document.body.scrollTop
            + document.documentElement.scrollTop;
    }
 
}
</script>

 

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...trying to call a javascript function from xslt.......trying to call a javascript function from xslt.......


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out