Solved

google Custom Search layout

Posted on 2008-10-21
5
261 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

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 …
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

738 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