
Script: php Site Recommender
Rights: © Revived Wire Media - revivedwire.com
==== Popup Method ====
[Installation]
- Open "form.php" and edit the "config" section
- Copy the code below and paste into a new page (or merge the code into and existing page)
- Use <a href="#" id="ajaxRecommender">Your link or image</a> to launch the popup
- Modify/use the included stylesheet (css/recommend.css) or merge into your existing styles
- Upload files/folders within the Popup_Method folder (no chmod necessary)
Here are the essentials to get you up and running:
<head>
<link rel="stylesheet" type="text/css" href="css/demo.css" /> * Not Required
<link rel="stylesheet" type="text/css" href="css/recommend.css" />
<link rel="stylesheet" type="text/css" href="css/lightview.css" />
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js"></script>
<script type="text/javascript" src="js/lightview.js"></script>
<script type="text/javascript">
document.observe('dom:loaded', function() {
$('ajaxRecommender').observe('click', showAjaxFormRecommender);
});
function showAjaxFormRecommender(event) {
Event.stop(event);
Lightview.show({
href: 'popup.php',
rel: 'iframe',
options: {
topclose: true,
width: 305,
height: 390,
ajax: {
onComplete: function(){
$('ajaxForm').observe('submit', submitAjaxFormRecommender);
}
}
}
});
}
function submitAjaxFormRecommender(event) {
Event.stop(event);
var text = $('ajaxForm').down('input').value.strip();
if (!text) return;
Lightview.show({
href: 'popup.php',
rel: 'iframe',
options: {
title: 'results',
menubar: false,
topclose: true,
autosize: true,
ajax: {
parameters: Form.serialize('ajaxForm')
}
}
});
}
</script>
</head>
<body>
<a href="#" id="ajaxRecommender">Your link or image</a>
</body>
</html>
|