anchor

Change background image of <li> on click of <a> tag

纵然是瞬间 提交于 2019-12-03 21:48:58
html: <ul> <li id="Co" class="libgc" ><b>CO</b></li> <li id="NSCO" class="libgc active"><span> <a href="#NSale.php" target="homeFrame" class="aclass">NSale</a></span></li> </ul> css: .libgc { background-color: #CCC; padding-top: 5px; padding-bottom: 5px; text-align: center; background-image: url(../images/pcnav.png); border: 1px solid #CCC; } jquery: $("li").click(function(){ $(this).css('background-image', 'url("images/btnSelectedTab.png")'); $(this).css('color','black'); }); }); Problem : When I click on first link its background image is changed, but again next time when I click on other

Outline applied to an anchor containing an image isn't the right height in Chrome

跟風遠走 提交于 2019-12-03 20:53:20
For a site I'm working on, I'd like to have a dotted outline appear around links when they are focused/hovered/active. I'd like this to happen for text and image links. The issue I have is that whilst my code works great in Firefox and IE, in Chrome 7.0.517.41 the dotted outline is the same height as my text, not the height of the image. Sample code: <!DOCTYPE html> <html lang="en"> <head> <style type="text/css"> BODY { font: 15px/1.5 sans-serif; } a:focus, a:hover, a:active { outline: 1px dotted #11aa22; } </style> </head> <body> <a href="#"> <img src="http://sstatic.net/stackoverflow/Img/wmd

Link to index page of website

主宰稳场 提交于 2019-12-03 17:07:02
问题 Is there a way to link to the index page of a website without specifying the name of the index page or the full website URL? I have this: <a href="index.htm">Home</a> But when I click the link, my address bar shows: mydomain.com/index.html I would like it to show: mydomain.com Can I do that without putting the full URL ( mydomain.com ) in the href ? If so, how? For future viewers, I also found this question helpful. 回答1: You can just do this: <a href="/">Home</a> Any href preceded by a slash

<iframe src=“reallylongpage.html#bottom” /> doesn't work

亡梦爱人 提交于 2019-12-03 16:16:50
I have the following embedded iframe <iframe width="100%" height="400" src="reallylongpage.html" /> reallylongpage.html has 2 anchors #top and #bottom I want my iframe to load reallylongpage.html at the bottom of the page so I did <iframe width="100%" height="400" src="reallylongpage.html#bottom" /> But this has the undesirable effect of scrolling both the iframe AND the parent page. The parent page shouldn't scroll at all. This happens in Chrome and Firefox. here is an example with full code parent.html <html> <body> <div style="padding:100 200;"> <iframe WIDTH="100%" HEIGHT="400" SRC="CHILD

Creating Image link with HTML Helper

删除回忆录丶 提交于 2019-12-03 14:08:08
I'm trying to create an image link with the HTML helper of Laravel 4. But it seems that isn't really working. I have this line of code {{ HTML::link("#", HTML::image("img/logo.png", "Logo") ) }} But that just outputs a strin like this: <img src="http://localhost/worker/public/img/logo" alt="Logo"> How come.?? You probably will have to: <a href="#">{{ HTML::image("img/logo.png", "Logo") }}</a> Because, link() uses entities to escape the title: public function link($url, $title = null, $attributes = array(), $secure = null) { $url = $this->url->to($url, array(), $secure); if (is_null($title) or

Anchor not to top of page, but 200px down

混江龙づ霸主 提交于 2019-12-03 13:39:38
I have an anchor on a element which makes the navigation jump to that point. However the anchor snaps it right up to the top of the viewport. Due do a fixed navigation, it's now hidden behind. Is it possible to make the anchor not snap to the top of the viewport and instead 200px down the page? Site here: http://www.haselden.co.uk/james/docs I was able to solve this by actually applying CSS to the anchor. So for the anchor I would have this... <a name="AnchorName" class="anchor"></a> And then in the CSS I would have this... .anchor { position: relative; top: -[number]px; } Note that I have

How to hide an anchor tag by href #id using css

三世轮回 提交于 2019-12-03 12:36:13
I have different anchor tags with href=#ids and I need to hide them using a general css rule for all of them, Content xxxxxxxxx <a href="#tab1">Table 1</a>.Content xxxxxxxxxxxx <a href="#tab2">Table 2</a> I was trying to use something like this: #wrap a='#tab1'{ display:none; } Any idea how to do it? Try using attribute selectors: a[href='#tab1']{ display: none } Or even simply [href='#tab1']{ display: none } http://www.w3.org/TR/CSS2/selector.html Why not just create a CSS class for your anchors and hide them using that class? <a href="#tab1" class="hiddenTab">foo</a> And in your CSS: a

AngularJS create html/link/anchor from text (escape/unescape html in view)

倾然丶 夕夏残阳落幕 提交于 2019-12-03 12:34:33
问题 I have a controller that has an assigned value: $scope.post = 'please visit http://stackoverflow.com quickly'; I have some text in my html: <p>{{post}}</p> I would like to make a clickable link of the url (surround it with anchor tags). I tried to change my html to: <p ng-bind-html="post | createAnchors"></p> Here is a simplified example of the problem: http://jsfiddle.net/T3fFt/4/ The question is, how can I escape the whole post text, except for the link, which will be surrounded by anchor

How to avoid anchors in iframes to scroll parent page

做~自己de王妃 提交于 2019-12-03 11:25:54
So, here's the problem: I have a quite long page with an iframe in the middle. Now, if an anchor is clicked in the iframe, the entire page is scrolled to the iframe, which is what I want to avoid. Here's an example: http://jsfiddle.net/ymbV7/1/ Don't scroll down the page, but scroll the iframe until you can see the "Contents" menu, and try any of the links (for example "Features"). I need the external page not to scroll, while the iframe has to correctly scroll to the clicked anchor. Any ideas? So you are telling that you want to move to a particular paragraph when clicked on the link which

Avoid the page scrolling/jumping when anchor is in the URL [duplicate]

有些话、适合烂在心里 提交于 2019-12-03 10:42:56
Possible Duplicate: jquery - disable anchor “jump” when loading a page I'm displaying a div depending on the hash value in a URL but i want to avoid the page jumping to the postion of that div with that particular ID. I only have the problem when the page is navigated direct with the hash in the URL so say for example if someone has book marked the page. So for example I have the url domain.com/page.html#myitem-1 ID=myitem-1 will then display, which it does but the page then jumps down to the postion of that div which i don't want. I was trying to use scrollTop(0) to force the window position