Display Box With Expanded Definition On Click?

Oct 16, 2010

I have pairs of terms and short definitions in a table. I want to display a longer definition in a box below the terms table when the term is clicked on. The box needs to disappear if clicked on. [code]...

View 6 Replies


ADVERTISEMENT

JQuery :: Unable To Display Collapsed Folder Correctly Once Expanded - CSS ?

Oct 27, 2010

When the left column first loads the vertical scrollbar displays correctly.

The vertical scrollbar is aligned up against the right border of the first column of the table which you can see by looking at the first image, and comparing it to the second.

Once I click on a folder in order to expand its contents, the vertical scrollbar introduces a gap of about 20 pixels as shown in the circle.

I looked at the css tag for the "classes" folder using firebug, and it showed {class ="directory collapsed", class= "directory expanded"} prior to and after expanding the contents of the folder.

I did a global regex search, within the project hierarchy, for (collapsed|expanded) and could not find any css that showed any margin-right for expanded, nor could I find any css at all related to "directory (collapsed|expanded)".

The only thing I found was that jqueryFileTree.js contained a function bindTree(t) with some code that toggled (collapsed|expanded):

Does anybody have a clue what is causing the gap once I click on a folder, and how to fix the problem?

Even if close the folder once the gap is there, I can't get rid of it unless I reload the page.

View 7 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

Dictionary Page - Display Definition Of Word OnClick

Oct 9, 2009

I am doing a distionary page with javascript and I am trying to get it so that the definitions come up when the word they are for is clicked on.

Here is my javascript
Javascript Document
var filename = "dictionary.js";
function loaded(which){
alert(which + " loaded");
}/**/
function showInfo(which){
var placeholder = document.getElementById("definition");
var source = whichInfo.getAttribute("href");
placeholder.setAttribute(source);
alert("showInfo called");
return false;
}function prepareList(){
if (!document.getElementsByTagName || !document.getElementById)
return false;
var words = document.getElementById("words");
if (!words) return false;
var links = words.getElementsByTagName("a");
for(var i = 0; i < links.length; i++) {
links[i].onclick = function(){
showInfo(this);
return false;
}}
alert("prepare list done");
}function init(){
prepareList();
}loaded(filename);
window.onload = init;

Here is my html
<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 StrictEN" "[URL]">
<html xmlns="[URL]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Dictionary DOM Scripting</title>
<link href="../styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="dictionaryScripts/dictionary.js"> </script>
</head><body>
<div class="page">
<div class="nav"><ul>
<li><a href="../home.html">Home</a></li>
<li><a href="../form/form.html">Form</a></li>
<li><a href="dictionaryCSS.html">Dictionary with CSS</a></li>
<li><a href="dictionaryDOM.html">Dictionary with DOM scripting</a></li>
<li><a href="discussionPage.html">Discussion</a></li>
</ul></div><div class="header">
<h1>Dictionary with DOM Scripting</h1></div>
<div class="mainContent">
<div id="words"><h2>L</h2>
<p>Click on the word to get a definition</p>
<dt><a href="lecturer.html">LECTURER, n.</a></dt>
<dt><a href="learning.html">LEARNING, n</a></dt>
<dt><a href="liar.html">LIAR, n.</a></dt>
<dt><a href="love.html">LOVE, n.</a></dt></div>
<div id="definition">Choose a definition</div>
</div></div></body></html>

View 5 Replies View Related

Double-click Online Dictionary Definition Script?

Sep 3, 2009

I've always wanted to help second-language English speakers access my site better, by offering a 'double-click on a word' definition in other languages. I had a useful script for some years which was rather dated, and ceased to work if there was an iframe on the page for some reason. Anyway, I found a very good solution at [URL]However, this opens the definition in a new tab/window.

Having experimented with it opening in a popup, I found problems in getting the popup to regain focus if someone had not closed it before looking for another definition. And anyway, popups can get blocked. So I found a nice layer/iframe solution at [URL] though their positioning of the layer is poor, at least in FF because it slides too far down below the bottom of the page. Their script is: [URL]I have modified that to work with dictionarist and stripped out their own floating part of the script, so that it works with position fixed for everything except IE6. But for IE6, I need to still change this from position fixed to position absolute, and then use a script to float the box.I have been trying the script I use successfully elsewhere in a vaguely similar context:

Code:

/* Script by: www.jtricks.com
* Version: 20060303
* Latest version:

[code]....

which has a call to startFloat(); near the end, which is based on their own floating script nearer the top of [URL] which I have removed. (Doubtless the references to Netscape (RIP) can be removed.)

View 4 Replies View Related

JQuery :: Losing Object Definition On Return To A Click Handler?

Feb 8, 2011

I am looping through an array of objects and creating an <li> element for each one and appending to a <ul> in the DOM. Works fine.During the looping I am also attached a 'details' object as data for the list element:$(thisListItem).data('details',{<obj>});Later, I am using the selector:$('ul#images_list li')to attach an on click function for each <li> element.In the click handler I am reading the data 'details' object for the <li> element:dataDetails = $.data(lotImage,'details');and, using the jAlerts plugin, I am opening a jPrompt which asks for the user to enter a price.

The jPrompt call includes a callback which receives the entered value as a parameter. The callback uses the value to 'post' the updated value, via $.ajax, to a server side unction.After OK is clicked in the jPrompt popup, in Firebug, I get an error that the dataDetails is undefined and it lists the line number in the click handler where I originally read the data object from the <li> element.I don't really understand why it should care after the click event has fired and the jPrompt callback has been invoked

View 3 Replies View Related

JQuery :: Simple Click(display) And Click(hide) Not Working?

Aug 15, 2011

I have this code:

$
(
'#region_dc').
click

[code]....

The click works fine. Check the checkbox, the hidden div displays. But when I uncheck the checkbox, I want it to go away.

View 3 Replies View Related

Switch Image On Expanded Content?

Mar 12, 2011

Im creating a javascript content expander and would like to know how to create it so it changed the image from an down arrows to open the box, and a down arrow to close the box.Here is my current code.

Code:

<script type="text/javascript">
//var persistmenu="yes"
var persisttype="sitewide"

[code].....

I want the <div class="rightnews"> thing to change from an up arrow to a down arrow.Here are the icons im using.for the box to contract:

for the box to expand.

View 1 Replies View Related

JQuery :: Deep Link To Expanded Section?

Jun 22, 2011

as you can see the items hide/show on click using a simple jQuery toggle. My question is, is it possible to link to my website with one section already expanded from an external source. I hope this question makes sense. Iv tried and failed by linking to the div id using #link but cant get that to work.

View 2 Replies View Related

User Moves His Mouse, Outline Will Be Expanded , What Function Is It?

Jul 23, 2005

I want to display the question and answer in the following way. When
the user moves his mouse to one question, the question will be expanded
to show detailed answer of that question.

For example,

1. What is UML?

2 How to implement it?

3 What is the advantage of UML?

When i move the mouse to the Question 1, the question will be expaned
and have a detailed answer of it; if i don't move to there, the
outline won't expand.

I search for a long time, but have no clue.
What functions should be use???

View 2 Replies View Related

JQuery :: Superfish - Set Active Menu Style When Submenu Expanded?

Jun 24, 2010

I'm almost done customizing the Superfish jQuery menu to fit my web site theme. I have all of the menu hover and submenu hover styles in place, but I'm having a problem with the color of the top-level menu item's font when the submenu is expanded. The active top menu item's background matches the hover color, but when I hover overa submenu item, the font color reverts back to the original (non-hovered) color. How do I get the top level menu item's color to match its hover color when the submenu is expanded?

The relevant portions of my CSS are as follows:
.sf-menu a, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/
color:#8C1C39;
}.sf-menu a.sfHover {
color:#FFFFFF;
}.sf-menu li {
background:transparent;
}.sf-menu li li {
background:#FFFFFF;
}.sf-menu li li li {
background:#9AAEDB;
}.sf-menu li:hover, .sf-menu li a:hover {
color: #FFFFFF;
background:#00207B;outline:0;
}.sf-menu a:focus, .sf-menu a:active,
.sf-menu li li a:hover, .sf-menu li.sfHover {
background:#8C1C39;
color: #FFFFFF;
outline:0;
}

Attachments
TopHover.jpg
Size : 10.86 KB
Download : 505
SubHover.jpg
Size : 9.33 KB
Download : 510

View 1 Replies View Related

Definition<b>s</b> Of Week Number?

Jul 23, 2005

Throughout the world in general, ISO 8601 Week Numbers are used, in
which weeks are numbered 01 upwards and Week 01 contains the first
Thursday of the Gregorian Calendar Year.

There are, however, odd parts of the world where that standard is not
followed.

Ignoring for the moment cases in which week 1 is not more-or-less at the
beginning of the calendar year, what other definitions, stated exactly,
are used?

View 4 Replies View Related

Using Eval() For Function Definition

Feb 19, 2007

I have this particular problem with eval() when using Microsoft
Internet Explorer, when trying to define an event handler. This is the
code:

function BigObject()
{
this.items = new Array();
this.values = new Array();
this.addItem = function( item )
{
this.items[this.items.length] = item;
}
this.makeHandlers()
{
var i, length = this.items.length;
for ( i = 0; i < length; i++ )
this.items[i].onclick = function()
{ alert( this.values[i] ); };
}}

However, this last code (makeHandlers() method) doesn't work since the
expression "this.values[i]" automatically belongs to this new
anonymous function, and therefore isn't valid (since the new anonymous
function(s) don't have the "values" attribute. So I tried the
following:

this.items[i].onclick = eval( "function() { alert( " +
this.values[i] + "); }" );

and it worked! ... in Firefox only :( Internet explorer returns
"undefined" for eval( "function() { /* whatever */ ); } " ), for the
same things Firefox perfectly understands, and if I try to make it a
handler, an exception is fired in IE. What do I do? Did I come to the
right conclusion with IE or am I making a banal mistake? Do I need to
find another way of solving this or is there a fix to this solution?

View 7 Replies View Related

Q About Function Definition Syntax

Aug 23, 2007

I had a look at sIFR.js code after parsing it and I have a question
about function syntax. For example

var f=function(){
// statements here
}();


What is the purpose if the second set of parentheses following the
closing brace? Is the intention to execute the function immediately
after it has been defined?

Most functions in sIFR.js do not have this syntax, but a few do.

View 1 Replies View Related

Function Definition Inside 'if' Statement

Oct 19, 2005

I debugged some html file and found this:

------------------------------------------------------------
<script language="JavaScript">

if ( some_statement ) {

function MyFunction ( some_argument ) {

some_function_statements;

}

}

</script>
------------------------------------------------------------

Is it allowed to define a function INSIDE some 'if' statement?

View 8 Replies View Related

Grab Elements Of DL ( Definition List )

Aug 30, 2006

I'm trying to grab all of the elements of a DL, specifically the <a href>'s
grouping them by the DD's. I suppose if I can just get them into groups I
can get the href's later. The hard part is getting them grouped as explained
below. For example...

<dl id="dlList">
<dt><a href="#2">DT Item1<span>(1)</span></a></dt>
<dd><a href="#">DD Item1<span>(2)</span></a></dd>
<dd><a href="#">DD Item2<span>(1)</span></a></dd>
<dd><a href="#">DD Item3<span>(1)</span></a></dd>

<dt><a href="#1">DT Item1<span>(1)</span></a></dt>
<dd><a href="#">DD Item1<span>(1)</span></a></dd>
<dd><a href="#">DD Item2<span>(1)</span></a></dd>
</dl>

Is there a way to say, loop through the DL until it finds a DT. Whe it finds
one, grab it and all of the DD's that immediately follow it .. until it
comes to another DT. Group it with its DD's and continue until no more DT's
are found.

Then maybe take these collections and possibly populate an array with the
groups?

View 11 Replies View Related

Mouseover On Definition List Effect?

Oct 3, 2010

There is an effect I would like to do but I don't know how it is done. To see something like it go to:[URL].. then mouseover the right side items under "most recently". It seems like there is a dt link which when mouseover occurs the dd data is presented.

View 4 Replies View Related

Recursively Calling A Function Within A Class Definition

Aug 13, 2007

i've got an object and i'd like to recursively call a function
within the class definition.

(i've simplified the code )

function myclass()
{
this.loop = function(index)
{
// ..work

setTimeout( "loop(" + (index+1) + ")", 100 );
}
}

does not work.

i've also tried

setTimeout( function() { loop(index+1) }, 100 );

i've also prefixed this. to loop in both cases - and no workee.

i think it's some sort of scope problem.

View 1 Replies View Related

Multiple Definition Lists - GetElementByID To Class

Apr 12, 2009

I am trying to use multiple instances of this little show/hide script for a definition list on the same page. However, the problem is that the definition list must be given an ID, and this can only be used once on a page. [URL]. How would I go about changing this to a class so that I could use it more than once on a page (i.e. multiple definition lists as opposed to one big one)? I changed all of the getElementById to getElementByClass and it didn't seem to work.

View 4 Replies View Related

Use Prototype Or Closures Inside Functinon Definition?

Aug 7, 2009

Is it better to use prototype when declaring classes or is it better to use closures inside the definition, e.g.:

Code:

Code:

What are the main differences, and is one method preferred to the other?

As use of the class is the same, I can't really decide which to use.

View 2 Replies View Related

Returning Reference To Function Definition When Using Self-Invocation?

Mar 26, 2011

I have this code:

HTML Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>

[code]....

The practical scenario is I have several functions attached to the jQuery ajaxSucess event. Each function needs to execute once during initial load and after when the JQuery ajaxSuccess event is fired. So I am just looking to see if I can eliminate a a few lines of code and learn something new in the process, that is really all.

View 7 Replies View Related

Changing Font-size Property In Body Definition?

Mar 27, 2010

I've got a website with font sizes using 'em's. I've made it so that in my 'body' CSS styling, I can change the font size and it changes it right throughout the whole site.

I have hyperlinks to increase and decrease the font size but have no idea how to get the links to change the 'font-size' property in my 'body' definition. As a secondary requirement (but not essential) I also need to remember this value and store in a cookie so the user doesn't need to keep resizing the page on every reload.

View 4 Replies View Related

JQuery :: DIV Display Above Other DIV On Click?

Apr 28, 2011

I wanna be able to click a div, and have it display above another div, on ever single div I have on my website I'm coding, (I also have it so I can click and drag divs as well) however I haven't had any luck.

For example if you head here -[URL]

I wanna be able to click and drag div1 and once it's clicked have it display above div2 and visa versa. As well as if I had 200+ divs on without a z-index applied to them via CSS.

This is the code I tried to achieve this effect, but didn't work.

$(document).ready(function(){
$("div").click(function(){
$(this).css('z-index','2');

[Code].....

View 4 Replies View Related

Click On One Textbox To Display In Another?

Dec 17, 2010

Looking to something similar to what one of my buddies did for his bball pool.[URL]When you click on the team name, it displays it in the next box. need to get this done for a intranet site.

View 2 Replies View Related

Display Hyperlink Name When I Click On Link Using Js?

Feb 2, 2010

This is my first question in DEVSHED and I hope to get answered. I want a script to display the hyperlink name when i click on the particular Link. code...

View 5 Replies View Related

JQuery :: Click To Display Text?

Apr 28, 2011

I have been working on some javascript code that will display text when clicked in a spearate div. I have got this to work but am struggling abit with additional groups of text on the same page.

A better way of explaining it might be:

I have 3 groups of football teams:

Group1
Man Utd
Chelsea
Arsenal

[Code].....

View 1 Replies View Related







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