I got this javascript widget finished the other day. It's called BoxOver and allows floating captions over HTML elements, similar to overlib but uses less CPU and is much smaller (<10kb).
Would be super keen to hear any comments/criticisms on it. Also if anyone has any ideas for changes that would be cool too....
I've got a simple javascript image gallery I'm using, but I was wondering if it would be possible to use HTML in the description area. Basically I want to be able to create paragraphs, bold text, and links in the description area. Is it possible? Here's what I'm using:
Then the markup: <img id="placeholder" src="images/twoBottles.jpg" alt="" /> (Where the image appears) <p id="desc">Choose an image to begin</p> (Where the image descriptions appear) <a onclick="return showPic(this)" href="images/condiments.jpg" title="The description which in some cases is 2 or 3 paragraphs long and I would like to format somehow">two bottles</a> (clicking this text opens that picture in the image area).
As i'm trying to find out how to get a graphical scrollbar to work, i decided that checkboxes and radio buttons shouldn't be the default, as css won't change their colours so does anyone know how to do these using images for Unchecked and Checked etc. Code:
but it uses external files and i couldnt get it to work on my site even with those. If they have to be there thats no problem but is someone able to help me get them working on a seperate site or another route to achieve the same end result?
I am doing a web development project.I have a product page which has 2 buttons. By pressing one button, a text box gets displayed and the user types in the value and after saving it the text box should disappear. When the user clicks the button again, the text box gets displayed and the user can type a new value(like text1, text2...).
There is second button, when it is clicked it displays the text box with the value that the user typed in the text boxes(text1,text2...). when we click the second button, it should display text1, text2... in a graphical view and the user can edit or delete the text boxes and rearrange the text boxes and save the online work in his webpage for future use.
I have HTML tags stored in XML. I want to be able to use these HTML elements with Javascript, just as you can with elements in document.body. How can it be done? (And don't try and tell me I should use server-side because I have written it all for Javascript and the project is nearly complete minus this and there are practical reasons for not doing this server-side. After all, anything is possible with Javascript!)
Let me explain:
- I have HTML templates such as this [URL]
- I want javascript to populate these templates then add them to my page
- The only way I know javascript can get this kind of data is by parsing XML
- I want to parse the XML then be able to use the HTML elements just like those in document.body
- As far as I'm aware, XML is the only good way of storing data for javascript. I don't want to store it in javascript variables (too much multiline data with " and '). Nor do I want to build it using document.createElement("div")... etc
As someone not yet with any experience in computer science etc, please ignore my poor terminology! However, I'm not a beginner when it comes to javascript.
Here's the script concerned but I doubt it'll help you understand my problem: [URL]
I am doing a website project and in that currently I am designing a product page. I have to design add values to text boxes and drag and drop the text boxes in the workspace and delete the text boxes the user does not want and have to draw a graphical line between the text boxes which are in order.I have designed and coded everything except the graphical line part.
I am a learner in javascript and Can we draw a graphical line dynamically between the text boxes in the webpage? If we can draw, can anyone let me know the tutorial for that so that I can learn and start coding as I have to submit that project soon.
I am doing a website project and in that currently I am designing a product page. I have to design add values to text boxes and drag and drop the text boxes in the workspace and delete the text boxes the user does not want and have to draw a graphical line between the text boxes which are in order.
I have designed and coded everything except the graphical line part. I am a learner in javascript and Can we draw a graphical line dynamically between the text boxes in the webpage? If we can draw, can anyone let me know the tutorial for that so that I can learn and start coding as I have to submit that project soon.
I have been trying to do the following. Using JS I want to create an input element (text box) and attach a event listener. I have done in in two different ways. The first is using xml elements directly (as in e4x) and the second using the dom method createElement (which is much clunkier to write). I'd prefer the former. I've included a stripped down example below.
It appears that when creating an input element using the line:
var inputBox = <input type="text" size="30" />
that it does not have the same properties as when it is created with:
var inputBox2 = document.createElement("input");
because when an event listener is attached using addEventListener, an error is generated on the first, but not the second.
My thoughts on this are either 1. The namespace for the input element is not correct and whether input can have a listener attached. However, my guess is that it would not show up in the first div box. Code:
I need to add different captions for each image of my onmouseover gallery. The way this gallery works is when the mouse goes over the text the image on the right changes. What should I add to my javascript code? This is the code I put in the head:
<script> /*Rollover effect on different image script- By JavaScript Kit (http://javascriptkit.com) Over 200+ free scripts here!
I'd like to add captions to this this simple JavaScript slideshow. I have looked and looked and can't find one that doesn't use tables for the captions. I'd really like to stick to <divs> if possible.
Code JavaScript: <script language="JavaScript"> var i = 0; var path = new Array();
1. I have a web browser component that does not support Javascript (well it does, but we've disabled it) 2. I have to display some HTML in it, where the user has a link titled "Hide|Show Options" that can hide/show a particular section of the HTML.
I have not found a way to achieve it without using Javascript or any other scripting language.
Is there a possibility to find out the coordinates, relative to the whole screen, or at least relative to the browsewindow, where an element ( e.g. link or picture ) begins or ends?
This may be a repeat post, but I can't seem to find the answer in these forums. Here is the question: I have a div with id "someDiv". I am obtaining an HTML string via XHR and intend to insert it in the DIV. I use .html(theHtmlString) and it renders just fine. But the newly inserted elements are not in the DOM - either by name or id. How do I register them in jQuery?
Before the canvas tag you had to write a script to make a gradient for html element backgrounds. Now you can use canvas and it's as easy as ... well messing with canvas. I have this script. At one point I had the gradient img objects resizing so the gradient would not get skewed. it was simple. just set the height% at the opposite ratio of the canvas width/height. But I went to make some changes and the next thing i knew that no longer worked. I don't remember how I did it!! I'm going to have to start over if I can't figure it out. Here's the script. Canvas only.
I haven't adapted with excanvas for IE yet, but that's coming when I can figure out how I had the thing working right. It's a css issue. I had thought I put the img objects in divs that were sized and positioned and then set the images to width 100% height= 100%*((canvas.width-canvas.height)/canvas.width) So in my example, the canvas was 100 x 30 and the factor is 7 so it would resize the image 700% and the height would grow by the relative amount to the setting I had it. I'll try to figure it out, but there's the script working somewhat. I want to figure out a way to resize the img objects when the user resizes the page, but I want the img to always maintain aspect ratio. [URL]
<script> /*ORIGINAL SCRIPT FOUND AT [URL]*/ window.onload = function () { var canvas = document.getElementById('c'); var ctx = canvas.getContext('2d'); var g = ctx.createLinearGradient(0, 0, 100, 50); g.addColorStop(0, 'rgba(255, 255, 0, 0.5)'); g.addColorStop(0.5, '#0ff'); g.addColorStop(1, '#00f'); ctx.fillStyle = g; ctx.fillRect(0, 0, 100, 50); var data = canvas.toDataURL(); document.getElementById('i').src = data; document.getElementById('EIMG').src = data;
I have a HTML document with form. The form has several radio buttons. I want different elements of HTML (including <input> elements) to appear when each radio button is selected. Also, it is intended to show only those elements for a specific radio button. For example, if i select RB1, it shows me element div 1 and hides all others. If i select RB2, it hides element div 1 and shows element div 2, et cetera. So far it works fine with .style.visibility = 'hidden' and 'block'. Now, here comes the problem - each element appears below the previous element, they appear as they are in the HTML, no matter if i show the previous one. It looks pretty bad, because element positions are jumping as i select different radio buttons. How do i keep them in the same level, at the same position?
The following is a JS ticker.It works well, but I can't figure out why the text in italic tags is being printed with the tags, instead of becoming italicized.example is here:
I've gone back and forth on the best way to store data in HTML elements which is used to support JavaScript. For instance, I might have a bunch of rows each associated with a SQL ID, and upon clicking the delete element, want to grab the id, and send it to the server. I've successfully used the following three solutions, but would like to standardize on just the best.
Option 1 is technically valid, but seems excessive. Option 2 will work fine, but is considered by some as bad practice. Option 3 requires the extra step of splitting the ID from some identifier string, and care not to have the same record twice on the page.
I've lately stepped up a little problem with one of my personal projects that i am working. I'm writing an aspx webpage, which includes web user controls inside it.
The webuser controls are within a web form (id=form1 runat=server) which resides in the
main.aspx page.
1. First of all, is there a way to find a SPECIFIC control inside the webuser control (ascx)
using Javascript in the main.aspx?
2. If not (which i think it is), which is the best way to do it? The snippet i tried was this:
Code: <script type="text/javscript" src="jquery-1.3.2.js"></script> <script type="text/javascript"> <!-- function doItAll(){ var a_p = ""; var d = new Date(); [Code]...
I have added the crossslide plugin to show a series of images, I have a couple of image that are too big for the area for these images so the crossslide plugin seems like an excellent option to pan thru images. Crossslide does not support captions though, and captions are absolutely necessary. To get it working for now I have used the cycle plugin for the captions, as I was not able to modify the crossslide plugin to fade captions. But of course, the timing of images changing and captions changing is not exact of eventually they don't match up. Not good.I was able to get the crossslide plugin to show the captions by modifying the plugin code in a small way.On line ~223 of the plugin i
modified this:elm = jQuery(format('<img src="{0}"/>', p.src)); to elm = jQuery(format('<img src="{0}"/><div class="caption">{1}</div>', p.src, p.caption));
I have been using Flash to create a slide show that starts with a single image. Then the image caption slides up from the bottom followed by a longer description coming in from the right side of the image (which includes links in the text). The description and caption then slide away, and a new image is transitioned into the old image's place. Is it possible to create something like this with jQuery? The s3slider jQuery plugin is very similar to what I'm looking for, but I can't seem to get two captions to appear over the same image.