Solved

google Custom Search layout

Posted on 2008-10-21
5
258 Views
Last Modified: 2013-12-09
hi expert,

I am trying to use google Custom Search  that uses (AJAX Search API)
the problem with the "overlay" thing, how can I put the results in a div (not the floating one)
0
Comment
Question by:uk1900
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:ShaneJones
ID: 22774265
Can you post the code for the custom search box please?
0
 

Author Comment

by:uk1900
ID: 22783659
hi shane,

this is the entire code u need to run google Custom Search  that uses (AJAX Search API)
the result is stored in <div id="results_014225229805397440211:2nf7dwv2h4e">
even if I put this div in a table it still float!


<form action="" id="searchbox_014225229805397440211:2nf7dwv2h4e" onsubmit="return false;">
  <div>
    <input type="text" name="q" size="40"/>
    <input type="submit" value="Search"/>
  </div>
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_014225229805397440211%3A2nf7dwv2h4e&lang=en"></script>
 
<div id="results_014225229805397440211:2nf7dwv2h4e" style="display:none">
  <div class="cse-closeResults"> 
    <a>&times; Close</a>
  </div>
  <div class="cse-resultsContainer"></div>
</div>
 
<style type="text/css">
@import url(http://www.google.com/cse/api/overlay.css);
</style>
 
<script src="http://www.google.com/uds/api?file=uds.js&v=1.0&key=ABQIAAAAtxM1lWeZiDd1zIcRffMrthQtyEiWRX5NtO9WcwCf_PcxrQYPQBQvGKuOH_Zu-yn_FSgyhelqhIoHIQ&hl=en" type="text/javascript"></script>
<script src="http://www.google.com/cse/api/overlay.js" type="text/javascript"></script>
<script type="text/javascript">
function OnLoad() {
  new CSEOverlay("014225229805397440211:2nf7dwv2h4e",
                 document.getElementById("searchbox_014225229805397440211:2nf7dwv2h4e"),
                 document.getElementById("results_014225229805397440211:2nf7dwv2h4e"));
}
GSearch.setOnLoadCallback(OnLoad);
</script>

Open in new window

0
 
LVL 12

Accepted Solution

by:
ShaneJones earned 500 total points
ID: 22784000
Line 17 links to http://www.google.com/cse/api/overlay.css

I'd suggest makign a copy of this at www.yourdomain.com/css/overlay.css

You can then edit it now.

Download a firefox plug in called Firebug, it lets you inspect elements. Make the search and get the box that floats in your browser, then hit F12 to launch firebug. Click on Inspect element on the left of the firebug window.

You will now see that the elements in the main window go a blue colour when you highlight them. find the element that is floating and left click.

in the firebug panel you will now see the code and on the right its css. Play around with the css to make the desired effect. When you have the panel how you want. edit your local copy of overlay.css

Hope this helps. let us know.
0
 

Author Closing Comment

by:uk1900
ID: 31508623
thx
0
 
LVL 12

Expert Comment

by:ShaneJones
ID: 22784374
Awesome, Hope this helps!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Finding (and replacing) text between two strings in Php 7 57
Remove lines by logo 2 30
bootstrap footer centering and columns alignement 3 58
ASP.NET MVC 2 31
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question