Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8458361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:03:32+00:00 2026-06-10T13:03:32+00:00

I’m trying to click a link & put that text into a jquery dialog

  • 0

I’m trying to click a link & put that text into a jquery dialog WITH its original styling (not the dialog’s style)?

I’m using jquery to do an element selection by mouse (like Firebug), then once I click on the element I want to add it into a div inside a jquery dialog box. Everything works fine except the styling – I want the clicked element’s style to be the same INSIDE the dialog box as it is on the third party page.

I’ve used http://www.wsj.com as the example here, but it could be any site – when it opens click on the SUBSCRIBE or LOGIN links on the right (they are orange until you hover, at which point they go white).

So – if I click on SUBSCRIBE – all I want is to have an ORANGE link in the dialog box of the same font-size and family as it is on http://www.wsj.com.

Notes:

  • If it’s not possible to get the original non-hover color (orange) I’d settle for the hover color (white). I just don’t want the color dictated by the dialog box styling (whatever it is – shown in this example as blue).
  • I need the ‘hello world’ div to be styled by the dialog box CSS, as it currently is

I suspect something around dialogClass might do it but I can’t get that to work.

Thanks to anyone who can help me here!

<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>
<style>
    .ui-widget-header { border: 1px solid green; background: #1f84f5 url(images/ui-bg_highlight-hard_75_1f84f5_1x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; font-size: 20pt; }
    .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222;  font-size: 20pt;}
</style>
<script>
    var $j = jQuery.noConflict();
    var horiz = ($j(window).width() / 2) - (750 / 2);
    $j(document).ready(function() {
        // MOUSE ENTER  
        $j("div,a").mouseenter(function (e) {
            $j(this).css("outline","3px solid green");
            var target = event.target || event.srcElement;
            stuff = target.outerHTML;
        });
        // MOUSE OUT    
        $j("div,a").mouseout(function (e) {
            $j(this).css("outline","0px solid");
        });
        // CLICK    
        $j("div,a").click(function (e) {
            e.stopPropagation();
            e.preventDefault();
            var thisCOL = $j(this).css("color"); 
            alert('to check : thisCOL='+thisCOL);
            document.getElementById('contents').innerHTML = stuff;
            $j( "#thedialog" ).dialog({
                title: "Dialog",
                height:'auto', 
                minHeight:300, 
                width:780,
                position: [horiz,50],
                modal: true,
                buttons: {
                    "Cancel": function() {$j(this).dialog( "close" ); },
                    "Save": function() {$j('#myform').submit(); }
                }
            });
        });
    });
</script>
    </head>
    <body>
<?php 
    $url = 'http://www.wsj.com';
    $data = file_get_contents($url);
    $data = '<head><base href='.$url.'/></head>'.$data;
    echo $data;
?>
<div id="thedialog" title="Simple dialog box" style="display:none">
    <div id="something">Hello world</div>  <!-- I need this to stay black, not inherit the wsj.com color -->
    <div id="contents">I want this text to be styled</div>  <!-- to be the right color from wsj.com -->
</div>
<!-- FORM submission code from dialog SAVE button left out for clarity  -->
    </body>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:03:34+00:00Added an answer on June 10, 2026 at 1:03 pm

    Easiest way to maintain the link colors etc inside of the dialogs is to just put another css addition to your current a {} css.

    #1:a, body .ui-widget-content a { /* whatever you want for both of them */ } body added to trump css specification-wise the css added by jQuery UI.

    example #1

    #2: #keepOriginal a { color:#5279a4; } #keepOriginal being some Div around it (or even a div wrapper around all your pages.)

    example #2

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm trying to select an H1 element which is the second-child in its group
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.