Alpha Video Training
Results 1 to 3 of 3

Thread: Javascript functions and href

  1. #1
    Real Name
    james conrad
    Join Date
    Jul 2009
    Dayton, OH

    Default Javascript functions and href


    I have been experimenting with CSS and Jquery.

    I have created a CSS navigation menu, with jquery animation effects..This works fine..

    However my navigation menu is written in an unordered list with href="" tags.

    I would like to call a javascript function to open a grid AddProducts();

    I have tried href="javascript:AddProducts();", href="onclick=AddProducts();", but this does not work.

    I want the link to open a div on the same page without redirecting to another html page with the grid on it.

    Is this possible?

    Any help would be greatly appreciated.


    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <meta http-equiv=Content-Type content="text/html; charset=unicode"><meta content="MSHTML 6.00.2900.6003" name=GENERATOR></head>
    <link rel="stylesheet" type="text/css" href="Jquery/css/redmond/jquery-ui-1.8.5.custom.css" />
    <script type="text/javascript" src="Jquery/js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="Jquery/js/jquery-ui-1.8.5.custom.min.js"></script>
    <link rel="stylesheet" type="text/css" href="navimain/style.css" />  
    jQuery(document).ready(function() {
    	jQuery("ul#topnav li").hover(function() { //Hover over event on list item
    		jQuery(this).css({ 'background' : '#1376c9 url(topnav_active.gif) repeat-x'}); //Add background color and image on hovered list item
    		jQuery(this).find("span").slideDown(800); //Show the subnav
    	} , function() { //on hover out...
    		jQuery(this).css({ 'background' : 'none'}); //Ditch the background
    		jQuery(this).find("span").fadeOut(); //Hide the subnav
    <body background="Windows_7_special_clean_HD_wallpaper 3.jpg">
    <ul id=topnav>
      <li><a id=OpenPopup href="#">HOME</a> </li>
      <li><a href="#">INVENTORY</a> <!--Subnav Starts Here--><span><a 
      href="#">PRODUCTS</a> | <a href="#">ADD PRODUCTS</a> | <a href="#">SEARCH 
      INVENTORY</a> </span><!--Subnav Ends Here--></li>
      <li><a href="#">STAGING</a> <span><a href="#">STAGING DATA</a> | <a 
      href="#">ADD STAGING</a> | <a href="#">SEARCH STAGING</a> </span></li>
      <li><a href="#">CUSTOMERS</a> <span><a href="#">ADD CUSTOMER</a> | <a 
      href="#">ADD CHILD CUSTOMERS</a> | <a href="#">SEARCH CUSTOMERS</a> 
      <li><a href="#">REPORTS</a> <span><a href="#">PRODUCT REPORTS</a> | <a 
      href="#">ACCESSORY REPORTS</a> | <a href="#">STAGING REPORTS</a> </span></li>
      <li><a href="#">ADMINISTRATION</a> <span><a href="#">ADD USERS</a> | <a 
      href="#">UTILITIES</a> </span></li>
      <li><a href="#">LOGOUT</a> </li></ul>

  2. #2
    "Certified" Alphaholic
    Real Name
    Lee Vasic
    Join Date
    May 2010
    Salt Lake City

    Default Re: Javascript functions and href

    Did you ever figure this out?

  3. #3
    Real Name
    james conrad
    Join Date
    Jul 2009
    Dayton, OH

    Default Re: Javascript functions and href

    Hi Lee,

    I did not find a solution to my issue. I ended up working with a tabbed UI.

    Also, take a look at some of my older posts, I did make a navigation menu using nothing but icons, made use of the Dojo kit to give it a mac toolbar look and feel, with javascript variables that opened in a DIV, but I let Alpha do all the heavy lifting.

    I created a component attached to a blank table, added Calc fields for BTN1 = "" , BTN2 = "", then attached images and a javascript 'onclick' event to open another component in a DIV.

    Last edited by jacktheripper; 02-13-2012 at 10:05 AM.

Similar Threads

  1. Action JavaScript not available in Grid Javascript function declarations
    By Clipper87 in forum Application Server Version 10 - Web/Browser Applications
    Replies: 1
    Last Post: 09-23-2010, 10:22 AM
  2. Where to put javascript functions?
    By tjmicro in forum Application Server Version 10 - Web/Browser Applications
    Replies: 7
    Last Post: 06-24-2010, 09:02 AM
  3. href syntax in the body of a Libraried HTML email
    By PCS in forum Application Server Version 8
    Replies: 1
    Last Post: 07-09-2008, 04:52 PM
  4. Mixing javascript and Xbasic and other javascript questions ...
    By drgarytraub in forum Application Server Version 9 - Web/Browser Applications
    Replies: 4
    Last Post: 07-08-2008, 06:15 PM
  5. href--> how to place alpha code
    By Willard in forum Web Application Server v6
    Replies: 5
    Last Post: 12-15-2004, 03:01 PM


Posting Permissions

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