anchor

how to get the caller element in href javascript function?

笑着哭i 提交于 2019-12-04 05:32:58
I have an anchor tag element coming in the html like: <a href="javascript:handleEvent(this, 'abc')"></a> Now in the javascript function, I have written: function handleEvent(sourceElement, txt) { console.log(sourceElement); } the consoled element is coming as the window in this case. I tried sourceElement.document.activeElement but it doesnt seem to work in chrome, where it is coming as body element. I cannot change the structure of the anchor tag to 'onClick' function as this is coming from some other source. Is there some way to find the calling element in this scenario? The real answer here

How to get rid of underline on <span> inside <a> tag with hover?

流过昼夜 提交于 2019-12-04 05:00:45
fiddle HTML <ul> <li><a href="#">Messages<span>1</span></a></li> </ul> CSS a { text-decoration: none; } a:hover { text-decoration: underline; } a:hover span { text-decoration: none; } span { background-color: red; border-radius: 999px; color: white; margin-left: 2px; position: relative; top: -.5em; font-size: .75em; font-weight: bold; padding: 0 .3em; } When you mouse-over the link the underline is applied to the <span> even though I've set text-decoration: none . Is there a way to get rid of it? Try changing the display of <span> to inline-block as follows: Example Here span { background

a:visited doesn't work in Mozilla Firefox

本小妞迷上赌 提交于 2019-12-04 04:31:15
I have created a link and when I try to set the style; a:visited { text-decoration: underline; color: #FF0000; } It doesnt seem to work. It works fine in IE. I have also followed the order; link, visited, hover, active. Is this a known issue, or am I making any mistake? Justin Gallagher It might have to do with specificity and the order that you have your selectors in. In general, when specifying link states, you should follow the " l o v e/ ha te" principal: : l ink : v isited : h over : a ctive Maybe you have the :hover or :active selector before :visited ? Download the Firebug or

Is it possible to access anchors in a querystring via PHP?

无人久伴 提交于 2019-12-04 04:14:35
问题 I have a page that is accessed via a URL like this: http://power-coder.net/Test/something.php?id=3#Page1 I know how to access the id parameter using $_GET, however is there a way for me to access the #Page1 part? I have looked at the $_SERVER array and the REQUEST_URI ends at ?id=3. I know that I could also change the #Page1 to be an additional parameter like &Page=1, however there is a fair bit of code using the old URL type that I would like to avoid re-writing if at all possible. Thanks

VB / C#: Resizing two controls equally

拥有回忆 提交于 2019-12-04 03:29:39
问题 I have made a window in which I will be having two groups/panels and some buttons in between them. I want to code the resizing behavior in a way that when the window expands, the two panels increase their widths while keeping the distance between them constant. Please see this mockup: As you see above, I want the 'Local' and 'Server' Panels to resize while keeping the distance in between them same. If I use anchors (Top+Left+Right+Bottom), the left panel will overlap the right one and the

FOP XSL-FO Anchor in an external destination

十年热恋 提交于 2019-12-04 03:22:56
With XSL-FO (Fop), I succeeded in creating a link to an external PDF : <fo:basic-link show-destination="new"> <xsl:attribute name="external-destination">foo.pdf</xsl:attribute> </fo:basic-link> But now, I would like to reach an anchor in this external PDF. So I tried to build something like that : <fo:basic-link show-destination="new"> <xsl:attribute name="external-destination">foo.pdf#anchorId</xsl:attribute> </fo:basic-link> Unfortunately, when I click on the generated link, I get an error. It tries to open the document foo.pdf%23anchorId . In my .fo file, the link is correct with a # but

How to normalize a button and an anchor with CSS?

谁都会走 提交于 2019-12-04 00:45:59
问题 Check out this code sample of a button and an anchor: http://jsbin.com/ecitex/2/edit I'm trying to make them identical in all browsers. But differences remain, and different differences in every browser (tried Chrome, Safari, Firefox, IE8). Which CSS normalizations am I missing? Update: Per suggested: I added line-height: 50px (although my user agent's (Chrome's) default line-height for button elements is normal , and still it vertically centers text – how?!) I added cursor: pointer to

knockout - HTML href

人走茶凉 提交于 2019-12-04 00:07:32
I have a foreach loop that goes through an array (filesObservableArray). The array has a key/value with the key: URLPath. When I bind the array within the HTML, I would like to set the 'href=' value with the URLPath. I know this part is a fail, but conceptually, can you see what I'm trying to do? href="< span data-bind='text: URLPath'>" Or maybe I can use a 'databind="click: someCode(url)"' and within the someCode function, open the link? The url maps to either a document file (e.g., .doc) or an image file. Tips appreciated. Thanks! <tbody data-bind="foreach: $root.filesObservableArray"> <tr

Getting an anchor element's absolute URL with jQuery

断了今生、忘了曾经 提交于 2019-12-03 23:24:32
Given an anchor element (with something like $("a:first") ), how do you get the absolute URL that the anchor points to? If you're using jQuery 1.6+, you can use .prop() : $("a:first").prop("href") Prior to 1.6, you can access the href property directly on the DOM element: $("a:first")[0].href; to get the URL attached you can do something like... var url = $("a:first").attr('href'); this will give you the URL but doesnt guarantee absolute or relative. To find the absolute URL you can further check if(!url.startsWith("http")) { url = "http://www.mysite.com" + url} var x = "http://lol.com/" + $(

Passing values to another php page using anchor tag

别说谁变了你拦得住时间么 提交于 2019-12-03 22:01:56
I try to pass value of PersonID from list.php to Delete.php. using anchor tag Here is my code : <A HREF = "Delete.php?PID = <?php echo $row['PersonID']; ?>"> Delete </A> The value is passed correctly but somehow I don't get redirected to Delete.php can anyone note the problem in the above line? Get rid of the space in your URL: <a href="Delete.php?PID=<?php echo $row['PersonID']; ?>"> Delete </a> Delete the spaces before and after the '=': <A HREF="Delete.php?PID=<?php echo $row['PersonID']; ?>"> Delete </A> If you have this: <a href="Delete.php?PID=<?php echo $row['PersonID']; ?>">Delete</a>