html

complex DIV overlapping and visibility with CSS

I'm looking to have an image object that looks like it's "pinned" to the side of my fixed-width page. but it seems to be contradictory - in order to style it, the div with the image has to be in a separate div than the main content, but in order for it to work in the layout, the div with the image can't be a separate div from the main co...

Calculating text selection offsets in nest elements in Javascript

The Problem I am trying to figure out the offset of a selection from a particular node with javascript. Say I have the following HTML <p>Hi there. This <strong>is blowing my mind</strong> with difficulty.</p> If I select from blowing to difficulty, it gives me the offset from the #text node inside of the <strong>. I need the string ...

CSS: squeeze multiple images close to each other

** Edit 3:** Another example of what I try to achive: +--------------------+ | | | +--++--++--++--+ | | |1 ||2 ||3 ||4 | | | | || |+--+| | | | +--+| |+--+| | | | +--+| ||7 |+--+ | | |5 |+--+| |+--+ | | | |+--+| ||8 | | | | ||6 || |+--+ | | +--+| |+--+ | | +--+ | | ...

ASP.NET MVC html page authentication

I have some static (pure html) pages in my MVC application that I need to authenticate, so that not just anybody can look at them. Is there an way to do this without moving all the code to asp files and adding a controller and from there use the Authorize attribute? I would really prefer to not need to do this! ...

JavaScript regex to replace a character ignoring HTML tags

Hello everybody, Once again, I need some help and I appreciate you all for being here willing to help. I'm trying to implement a regex for a JavaScript function that will replace a string of text contained in an HTML tag, but ignoring the tag altogether. For example: The string I need to find and replace is the dollar sign ($), and the H...

problems generating "checked" checkboxes from a MySQL generated list of checkboxes.

I am generating a group of check-boxes from a MySQL database with this code. $connection=mysql_connect ("localhost", "foo", "bar") or die ("I cannot connect to the database."); $db=mysql_select_db ("database", $connection) or die (mysql_error()); $query = "SELECT type FROM typelist ORDER BY type ASC"; $sql_result = mysql_query($query, ...

Adding rows dynamically jQuery -(copying existing HTML)

Hello all, I was looking at adding rows dynamically to my HTML table using jQuery with the following requirement. The table has 9 columns, of which 1 columns has a button for adding a new row. The new row added should be added after the current row and have the first 7 columns blank, 8th column should be a exact replica of the previou...

Dotted table borders abutting and overlapping in IE6/7

I have some <td> elements with dotted 1px borders on the bottom. Each element is fixed width. This means that sometimes the borders end up like this, with abutting dots that make a dark spot in the border: -- -- -- --|-- -- -- -- but other times they render correctly, like this: -- -- -- --| -- -- -- I can move them around by chang...

Looking for a great Ajax enabled datagrid that will work with .net MVC

I am researching writing a website in Asp.Net MVC 2, it will rely heavily on a datagrid control for showing data and editing data. Ideally it would support AJAX so the page doesn't have to reload with every update. Rather than writing this from scratch, does anybody know of a really great, well supported 3rd party control for doing this...

Are HTML5 tags are not block level elements?

If I have a HTML element <header> and apply some margins to this HTML5 element through CSS as: header{ margin:10px 0; } The <header> element is not spaced 10 px from rest of the elements. But if I modify my CSS rule like below: header{ margin:10px 0; display:block; } then the <header> element is spaced accordingly. So, my q...

Aligning 3 texts (left, center and right) in a DIV

Hello, I am trying to make a sort of progress bar that gets filled, with text inside that is on the left, in the center, and SOMETIMES on the right. I got it (almost) working, my only issue so far is that sometimes the text in the middle gets too long, and so it gets spanned out of the div. Meaning it wraps around, and takes sort of 2 ...

Vertical text alignment alongside images

When I put an image inline in a table cell, like this: <table border="1" cellspacing="5" cellpadding="5"> <tr> <td> <img width="20" height="20">Text </td> <td> Text </td> </tr> </table> …it shifts the vertical alignment of the text in that cell, like this: I've played around with vertical-align, but haven't been abl...

mailto: replacement due to size

I have a web page that generates several email addresses. I need to be able to click on a link, which will open an email client such as outlook and populate the bcc field with those email addresses. In the past, we have used html's mailto, which achieves this goal perfectly. My problem now is that I need to send emails to over 200 p...

The State of contenteditable

The State of contenteditable The markup produced by wysiwyg editors is atrocious. Its littered with style attributes and often is not even valid HTML (missing closing tags, overlapping styling, etc). Are there any established solutions to the problems introduced by contenteditable? If not, how can I go about creating one? Invalid HT...

image display based on condition in Vs 2005 asp.Net

I have used the below code to display image on top of the page. For condition1 div1.Visible = true; div2.Visible = false; For condition2, div1.Visible = false; div2.Visible = true; and the code in the aspx page is like this. <div id="div1" runat="server" style="padding-left: 110px;"> <img src="~/images/Package-Summary.gif" alt...

Is there a JQuery plugin for the iPhone that will notify the user to "Bookmark" their app?

Because it is not possible to force the iPhone to bookmark a webpage, I want a little arrow/bow to drop down to notify people to bookmark my mobile web page. ...

avoid loading images using javascript

Say I have the following code in my html: <html> <....> <img src="the-image.gif" /> <....> </html> Is it possible to avoid loading the image using javascript? I want to load it later, using javascript. But I don't want it to be loaded automatically. I am trying to delay the request of the image. Thanks ...

Fire next event up, but not after that.

For a page, I've been given a link wrapped inside a label, like this: <label for='checkbox_elem'> Links to <a href='somepage.php' target='anotherwindow'>another page.</a> </label> When the user clicks on the link in all browser, the page is spawned in a new tab as envisioned, but in Firefox the checkbox linked to the label is also...

Setting a cookie with jQuery Cookie plugin?

Hello all. I am trying to create a popup ad with a custom lightbox feel and I can get the popup to work, but it is not setting the cookie. Any ideas on what this could be? Since the code is so long, I am posting it as a GitHub Gist here: http://gist.github.com/501348 Thanks in advance all, Josh ...

Loading content on a webpage only when a part of the webpage is displayed on the browser

Hello, in some pages i see when you arrive at the end of the page the page automatic loads new data. For example, some blogs when you get to the end of the page (that only loads 10 articles when you get there), the page load 10 articles more without pressing anything, so the questions will be, How do i execute/triger a php/javascript com...