Creating Menu Link That Opens New Page And Call Function

Jun 21, 2011

I would like to include drop-down navigation links on my home page that connect to other pages on my website. No problem there. The problem is that some of the other pages contain a series of div elements that are hidden (display:none) until activated by javascript enabled links on the page. Clicking those links changes some of the page's content (within a div) .. almost like a "new" page. [URL]. Here's my question: Is there any way to create menu links on my home page that will open the "concert.html" page AND display the appropriate div content at the same time?
For example: on the home page, a menu link under "Concert" that opens that page and automatically displays the "Rock Symphonies" section?

Here are the related HTML div elements on the "concert.html" page:
<div id="page1">concept content</div>
<div id="page2" style="display:none;">rock symphonies content</div>
<div id="page3" style="display:none;">general program content</div>
<div id="page4" style="display:none;">ticket price content</div>
<div id="page5" style="display:none;">concert committee content</div>

Here are the corresponding js-enabled links:
<li><a href="javascript:page(1,5);" id="tag1">Concept</a></li>
<li><a href="javascript:page(2,5);" id="tag2">Rock Symphonies</a></li>
<li><a href="javascript:page(3,5);" id="tag3">General Program</a></li>
<li><a href="javascript:page(4,5);" id="tag4">Ticket Prices</a></li>
<li><a href="javascript:page(5,5);" id="tag5">Concert Committee</a></li>

And here's the javascript I'm using: (scripts/generator.js)
function page(id,all) {for (i=1; i<=all; i++) { if (i==id) {
document.getElementById('page'+i).style.display="inline";
document.getElementById('tag'+i).style.fontWeight="normal";
document.getElementById('tag'+i).style.color="#FFF"; }
else {
document.getElementById('page'+i).style.display="none";
document.getElementById('tag'+i).style.fontWeight="normal";
document.getElementById('tag'+i).style.color="#a4bfed";} }}

View 2 Replies


ADVERTISEMENT

A Link That Opens A New Page Based On Info Within A Link

Dec 21, 2011

Is it possible to have a link with an id within it such as

<li><a href='newpage.html' id='12'>Some title</a></li>

when you click on the link a new page html page opens and on that new page, information found in a database with the id of 12(as found in the link) will be displayed using external style sheets etc. Can this be done with html css javascript and json? P.S I know how to do this with php however I want this to be done in my mobile app so the actual page cannot be a .php page

View 4 Replies View Related

Edit Function So The Link Opens In New Window

May 14, 2009

I have the following html code, that is an input Button and onclick runs the javascript function EnquiriesReport().

<input type="Button" name="Enquiries" value=".Enquiries" onClick="EnquiriesReport()" class="formsubmitTwo">

Here is the javascript code for the EnquiriesReport() function:

function EnquiriesReport()
{
if( ValidateData()) {
form1.action="EnquiriesReport.asp?"
form1.submit();
}
}

My question is how can I run the EnquiriesReport() function so that the "EnquiriesReport.asp?" opens in a new window?

View 1 Replies View Related

Perform A Find In Page Search That Looks At A Specific Link, Opens The Page In A New Window?

Mar 29, 2011

It is possible to perform a find in page search that looks at a specific link, opens the page in a new window and finds the text within that document?? Basically I regularly use an html page in work that has a list of people and their telephone numbers. I want to be able to type in a searchbox on my main page and it open the target page and find the name I am looking for? Is this possible or can you only Find In Page on the same page or another frame?

View 1 Replies View Related

Creating A Link To Call Php Code

Sep 16, 2010

I want to have a link that when clicked on will call a specific php code. So when you click on the LSS link it sets a value to lss that I can call later with the php. This is what I have:

[Code]...

View 6 Replies View Related

Creating URLs From Function Call Operators

Jul 20, 2005

Is it possible to create URLs from function call operators?

For example, I'm trying to program an onClick function which will load a
webpage in one frame and an image in another, based on the name of the
button which is being clicked. So clicking the button with name="help" will
open "webpages/help_page1.html" in one frame, and "images/help.jpg" in
another.

To do this I was hoping that the following would work, where the function
had been called by

function activate(buttonName) {
webpageURL="webpages/"+buttonName+"_page1.html"
imageURL="images/"+buttonName+".jpg"
parent.frame1.location.href=webpageURL
parent.frame2.picture.src=imageURL
}

But this doesn't work, because the browser (IE6) looks for
"webpages[object]_page1.html" and "images[object].jpg".

View 2 Replies View Related

Creating Links That Opens A Newly Targeted Window And Changes The Current One

Jun 30, 2010

Anyone know how to create this in JS? User clicks on a link, the link opens a new window with new webpage AND the page that had the link then changes to a new webpage as well. So end the end that link takes the user to two new pages. For instance, I am on PageA.html and I click an <a href="">Link</a>. Link take me to a newly targeted page called PageB.html. Then at the same time PageA.html turns into PageC.html.

View 1 Replies View Related

Creating A Link With A Javascript-read XML Page

Oct 24, 2005

I have an XML document which lists some information about movies(Title, actor, etc.) I am using Javascript to pull that data and display it as html. Is it possible to create a link for each one of those titles that are pulled from the XML in my JS? Here is my code:

for (var i=0; movies.length > i; i++)
{
var Title = movies[i].getElementsByTagName("title");
var Actor = movies[i].getElementsByTagName("actor");
var Price = movies[i].getElementsByTagName("price");
results += i+1 + '. ' + ' "<span class="title"><a href="http://www.imdb.com">' + Title[0].firstChild.nodeValue + '</a></span>"' +
' starring <span class="actor">' + Actor[0].firstChild.nodeValue + '</span>' + ' and costs approximately $'+ Price[0].firstChild.nodeValue + "<br/>

";
}

document.getElementById("displayresults").innerHTML = results;

View 5 Replies View Related

Creating A Visited Link In The Nav Section Of A One Page Website?

Oct 5, 2010

Anyone know how I can change the color of a text link on a page that doesn't load a new page, but rather stays on the same page?The nav links already use an onClick to present content below it that changes depending on what link in the nav I select. In other words, there's already two things going on -- links take you to content on the same page using a JS onClick.What I want to add to that is when you click on the link, it changes style, like turns bold or changes color. So then the user knows that not only have they selected new content, but the link they selected stands out as well.

View 1 Replies View Related

Call Javascript Function From Pdf Link

Jun 24, 2007

I have a script that is working well to detect if the client has acrobat reader is installed or not. I can print out next to the PDF link if the user has or hasn't got the reader. My problem is that i want to call that function and print something out only if the user clicks on the link to see the PDF file. This is where i'm at at the mo

echo "<br>Price: Euro ";
echo $price."<br />";
echo "<a href = "pdf/$pdf">";
?>
<script type="text/javascript" src="plugins.js">
</script>
<?php
echo "See Pdf</a></td>
";

?>
</tr>

View 1 Replies View Related

How To Call A Function For Every Onmouseover A Link?

Dec 12, 2007

I am doing a GreaseMonkey script and I need to call a function "myFunction" everytime a user hover over any link on the page.

View 4 Replies View Related

Create Link For Opens In Another Tab ?

Aug 27, 2010

i created one blog . In that i put other site links . When users clicked that link it opened in the same tab . i need html codings to open in another tab if users click that link .

View 2 Replies View Related

JQuery :: Activate A Click Dynamically On A Link And Also Call Another Function?

Apr 23, 2009

I have a link as follows.

<a href="march2009.html" onclick="return hs.htmlExpand(this,
{contentId: 'highslide-html-1', objectWidth: 600, objectHeight: 510,
width: 600})" id="leadershipMsgId" class="highslide whiteul">Message</

[code]....

View 1 Replies View Related

Make The Image Map Call A Function Instead Of A Link For Searching Site

Feb 10, 2011

I want to use an image map for something unique. The image would have about 10 to 15 (religious) symbols. When the user clicks on a particular symbol it will search the site for a few strings relating to that symbol. For example: Symbol 1 would be a cross when clicked it search the site for "christ, crucifix, christianity". I am sure I can make the image map but how do I make the image map call a function instead of a link.

View 7 Replies View Related

Drop Down Menu That Opens Div With 2 Radio Buttons?

Mar 17, 2009

How would I go about coding this? If they select No the div with the radios would open and be required.

[URL]

View 4 Replies View Related

A Website Opens In My Iframe Is There A Way To Know The Address Of The Link The Visitor Clicks On ?

Jul 20, 2005

a website opens in my iframe Is there a way to know the address of the
link the visitor clicks on?

View 2 Replies View Related

JQuery :: Make A Conditional Function For A Menu So The Current Link Does Another Roll Over?

Nov 1, 2010

I'm trying to build a menu with an animation color and my problem is that the funtion is apply to all the links in the menu but ideally I would like to apply to all elements less the one with the id current.

at the moment I just created two functions but still apply both of them to the current link.

Here is the code:

<script type="text/javascript">
// font color animation
$(".second a").hover(function() {
$(this).animate({ color: "#00aadd" }, 400);

[Code].....

View 1 Replies View Related

Call A Function That Is In Another Page?

Nov 8, 2009

I have tow page and the first page open a new window with javascript(by using window.open).Now I want to call a javascript function that is in the first page from the second page and for that i use parent.function_name but it doesn't work.How can do so?

View 5 Replies View Related

Call Function In Web Page?

Mar 13, 2010

How to call javascript function in a web page?e.g. Putting the following code alert('test');in a web page will display the string "alert('test');".No alert box appears.

View 1 Replies View Related

Call Function In .aspx Page?

Jan 6, 2009

i have a function test() in a external js file i want to call it in my .aspx page how do i call it i tries using dim dv= externalfile.getfilters() ealier my function was in the same page and hence wrking fine dv= getfilters()

View 2 Replies View Related

Can't Get Html Page Call Js Function

May 28, 2010

how to call my js function on the HTML page. This is a homework assignment and I've written the code but I just can't make it work. I can get the prompt boxes but the results don't show.

The assignment is to calculate basketball ticket prices. Each ticket has a base price. An up-charge or down-charge % is applied to the base price depending on the seat location. Courtside seats command a 20% premium upcharge Lower bowl seats have a 12% premium upcharge Inexpensive upper bowl seats cost 5% less than the stated base ticket price. If more than 8 tickets are purchased, 5% will be deducted from the total.

I have to use prompt() in my html page to prompt user for information. Then I'm to call the function to calculate the answers and build HTML to ouput.

look at what I have and offer advice as how to fix my code.

Here's my js file:
function calcTotalTicketCost(baseTicketCost, totalNumberTickets){
var courtside = 0.20;
var lowerbowl = 0.12;

[Code]....

View 4 Replies View Related

Expanding Menu To Stay Expanded When Click A Link To Go To Another Page While Navigating?

Jun 29, 2010

I am doing an internship at a company and am working on an existing site. The Company wants the expanding menu to stay expanded when you click a link to go to another page while navigating. I am very new to Javascript, CSS, and html and could really use some insight or code example.

// JavaScript Document
/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com

[code]....

View 1 Replies View Related

JQuery :: Call The Same Function Two Times In The Same Page?

May 22, 2011

I need to call the same function two times in the same page. So instead of doing this:

$("button").click(function(){
instructions.....
});

[code]....

If yes, what is the correct syntax, then? because what i posted here does not work.

View 1 Replies View Related

JQuery :: Call A IFrame Page Function

Apr 24, 2011

I have three pages and let me explain through the sample.

page1 : index.html

Code:

page2 : screens.html

Code:

page3 : controller.js

Code:

I am running the index.html and not getting the content of controller.js -> myFunction().

But if I put a breakpoint using FireBug in Mozilla Browser at the beginning of $(document).ready(function(){,

Then the myFunction is called and working fine. How to run the index.html without breakpoint and get the iframe content.

View 1 Replies View Related

Ajax :: Call Function From Page Thats Been Called?

Jan 30, 2010

like theres two pages.page one calls page two and displays the output of page 2 on page 1 via ajax.now can i click on page 2's output(on page one) and have it execute another javascript function to call AJAX(a third page)

View 1 Replies View Related

Jvs Function Which Opens New Window

Jul 13, 2007

function gotoshow(){
if (!window.winslide||winslide.closed)
winslide=window.open(slidelinks[whichlink])
else
winslide.location=slidelinks[whichlink]
winslide.focus()
}

I need to change this function to DO NOT open "slidelinks" in new window, but in same window as the image witch uses this function.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved