jquery - is it possible to get anchor visited state from javascript? -
- I am using jquery. I have an anchor list. I am telling anchor, if this visit If done, set display: none;
- I need this when I click on the anchor, the javascript will change the state visited the anchor?
How can I do that?
Yes, for an example see. To find out that a link has been visited, it uses a getcomputedStyle
also there is a form of this hack.
The relevant section of the example is (modified for clarity):
a: visited (color: # 00f;} var link = document.createElement ('a' ); Link.href = 'http://example.com/'; document.body.appendChild (link); var color = document. DefaultView.getComputedStyle (link, empty) .getPropertyValue ('color'); // Check to tour if (color == "RGB (0, 0, 255)") {Warning (link.href + 'has been visited');}
I can ask what you want for it?
Edit: WRT # 2, you can open links in iframe
It will be marked as such that the browser was viewed in history like:
var iframe = document.createElement ('iframe'); Iframe.src = 'http: // example .com / '; document.body.appendChild (iFrame);
Edit : You can create new CSS rules with JS. Actually, you will do it like this:
$. Rule ('a: visited (color: # f06! Important) '). Attachment ('style');
Comments
Post a Comment