"load externa html in overlay" to work, You can check i at victorjohansson.se
HTML with overlay in wordpress Created Aug 4, 2010
This thread is solved
Views: 2226 Replies: 13 Last reply Sep 3, 2010
You must login first before you can use this feature
Im trying to get the jquery tool to work in wordpress however there are realy big issue when trying to get it to work. i have manage to make tool tip work but can get the
"load externa html in overlay" to work, You can check i at victorjohansson.se
"load externa html in overlay" to work, You can check i at victorjohansson.se
Reply to:
HTML with overlay in wordpress, from
victorjohansson
Hi Victor,
I'm struggling to find any links on your site that are actually loading in external content - is this because you wanted to not put on the links to external files until you got them working? If so, are you able to provide a page where we can see what you've tried to do, so that we can help? This can be a test page if this helps - it does not have to be part of the site, as long as it has the code on so we can see where you might be having a problem.
Thanks,
Alex.
I'm struggling to find any links on your site that are actually loading in external content - is this because you wanted to not put on the links to external files until you got them working? If so, are you able to provide a page where we can see what you've tried to do, so that we can help? This can be a test page if this helps - it does not have to be part of the site, as long as it has the code on so we can see where you might be having a problem.
Thanks,
Alex.
Reply to:
» HTML with overlay in wordpress, from
alibby
you can see the page by loging in
as editor as victorjohansson.se/wp-admin
username : developer1
pass: dev1234567
thanks
as editor as victorjohansson.se/wp-admin
username : developer1
pass: dev1234567
thanks
Reply to:
» » HTML with overlay in wordpress, from
victorjohansson
Hi Victor,
I've had a look - as far as I can see, it looks like you're just trying to get the code to work, and not do anything special, correct?
I have a copy of the demo code which works on its own; I'm working on putting this into Wordpress, so may not be able to get a response to you until tomorrow - is this OK?
Alex.
I've had a look - as far as I can see, it looks like you're just trying to get the code to work, and not do anything special, correct?
I have a copy of the demo code which works on its own; I'm working on putting this into Wordpress, so may not be able to get a response to you until tomorrow - is this OK?
Alex.
Reply to:
» » » HTML with overlay in wordpress, from
alibby
that works for me, i did copy the code from the demo page right of to see if that were working, bu i may ahve miss something .
regards
victor
regards
victor
Reply to:
» » » » HTML with overlay in wordpress, from
victorjohansson
Hi Victor,
Ok - give this code a try, as a standalone HTML page outside of Wordpress. This worked for me - you need to add 2 additional HTML files, which have some form of text or images in them; call them "external-content.htm" and "external-content2.htm":
<!DOCTYPE html> <html> <head>
<title>jQuery Tools Test</title>
<script src=http://cdn.jquerytools.org/1.2.3/full/jquery.tools.min.js"></script>
<link rel="stylesheet" type="text/css" href=http://static.flowplayer.org/tools/css/overlay-apple.css"/>
<style>
#overlay { background-image:urlhttp://static.flowplayer.org/img/overlay/transparent.png); color:#efefef; height:450px; }
div.contentWrap { height:441px; overflow-y:auto; }
</style>
</head>
<body>
<button type="button">Show external page in overlay</button>
<button type="button">Show another page</button>
<div class="apple_overlay" id="overlay">
<div class="contentWrap"></div>
</div>
<!-- make all links with the 'rel' attribute open overlays -->
<script type="text/javascript">
$(function() {
// if the function argument is given to overlay,
// it is assumed to be the onBeforeLoad event listener
$("a[rel]").overlay({
mask: 'darkslateblue',
effect: 'apple',
onBeforeLoad: function() {
// grab wrapper element inside content
var wrap = this.getOverlay().find(".contentWrap");
// load the page specified in the trigger
wrap.load(this.getTrigger().attr("href"));
}
});
});
</script>
</body>
</html>
This should not require any additional images, etc - can you please give this a try, and at least confirm this works for you?
Ok - give this code a try, as a standalone HTML page outside of Wordpress. This worked for me - you need to add 2 additional HTML files, which have some form of text or images in them; call them "external-content.htm" and "external-content2.htm":
<!DOCTYPE html> <html> <head>
<title>jQuery Tools Test</title>
<script src=http://cdn.jquerytools.org/1.2.3/full/jquery.tools.min.js"></script>
<link rel="stylesheet" type="text/css" href=http://static.flowplayer.org/tools/css/overlay-apple.css"/>
<style>
#overlay { background-image:urlhttp://static.flowplayer.org/img/overlay/transparent.png); color:#efefef; height:450px; }
div.contentWrap { height:441px; overflow-y:auto; }
</style>
</head>
<body>
<button type="button">Show external page in overlay</button>
<button type="button">Show another page</button>
<div class="apple_overlay" id="overlay">
<div class="contentWrap"></div>
</div>
<!-- make all links with the 'rel' attribute open overlays -->
<script type="text/javascript">
$(function() {
// if the function argument is given to overlay,
// it is assumed to be the onBeforeLoad event listener
$("a[rel]").overlay({
mask: 'darkslateblue',
effect: 'apple',
onBeforeLoad: function() {
// grab wrapper element inside content
var wrap = this.getOverlay().find(".contentWrap");
// load the page specified in the trigger
wrap.load(this.getTrigger().attr("href"));
}
});
});
</script>
</body>
</html>
This should not require any additional images, etc - can you please give this a try, and at least confirm this works for you?
Reply to:
» » » » » HTML with overlay in wordpress, from
alibby
Hi, thanks
i will try it outside wordpress, however i need it to work on wordpress platform, si i will try both
i will try it outside wordpress, however i need it to work on wordpress platform, si i will try both
Reply to:
» » » » » » HTML with overlay in wordpress, from
victorjohansson
Hi Victor,
Don't worry - I also want it to work in Wordpress. I'm working on this now, as I write...I will post as soon as I have an answer!
Oh - and oops - sorry: my fault - I think I posted the wrong code up! If the above code does not work, give this version a go:
<!DOCTYPE html> <html> <head>
<title>jQuery Tools Test</title>
<script src=http://cdn.jquerytools.org/1.2.3/full/jquery.tools.min.js"></script>
<link rel="stylesheet" type="text/css" href=http://static.flowplayer.org/tools/css/overlay-apple.css"/>
<style>
#overlay { background-image:urlhttp://static.flowplayer.org/img/overlay/transparent.png); color:#efefef; height:450px; }
div.contentWrap { height:441px; overflow-y:auto; }
</style>
</head>
<body>
<button type="button">Show external page in overlay</button>
<button type="button">Show another page</button>
<div class="apple_overlay" id="overlay">
<div class="contentWrap"></div>
</div>
<!-- make all links with the 'rel' attribute open overlays -->
<script type="text/javascript">
$(function() {
// if the function argument is given to overlay,
// it is assumed to be the onBeforeLoad event listener
$("a[rel]").overlay({
mask: 'darkslateblue',
effect: 'apple',
onBeforeLoad: function() {
// grab wrapper element inside content
var wrap = this.getOverlay().find(".contentWrap");
// load the page specified in the trigger
wrap.load(this.getTrigger().attr("href"));
}
});
});
</script>
</body>
</html>
Don't worry - I also want it to work in Wordpress. I'm working on this now, as I write...I will post as soon as I have an answer!
Oh - and oops - sorry: my fault - I think I posted the wrong code up! If the above code does not work, give this version a go:
<!DOCTYPE html> <html> <head>
<title>jQuery Tools Test</title>
<script src=http://cdn.jquerytools.org/1.2.3/full/jquery.tools.min.js"></script>
<link rel="stylesheet" type="text/css" href=http://static.flowplayer.org/tools/css/overlay-apple.css"/>
<style>
#overlay { background-image:urlhttp://static.flowplayer.org/img/overlay/transparent.png); color:#efefef; height:450px; }
div.contentWrap { height:441px; overflow-y:auto; }
</style>
</head>
<body>
<button type="button">Show external page in overlay</button>
<button type="button">Show another page</button>
<div class="apple_overlay" id="overlay">
<div class="contentWrap"></div>
</div>
<!-- make all links with the 'rel' attribute open overlays -->
<script type="text/javascript">
$(function() {
// if the function argument is given to overlay,
// it is assumed to be the onBeforeLoad event listener
$("a[rel]").overlay({
mask: 'darkslateblue',
effect: 'apple',
onBeforeLoad: function() {
// grab wrapper element inside content
var wrap = this.getOverlay().find(".contentWrap");
// load the page specified in the trigger
wrap.load(this.getTrigger().attr("href"));
}
});
});
</script>
</body>
</html>
Reply to:
» » » » » » » HTML with overlay in wordpress, from
alibby
Hi Victor,
I think I am getting somewhere, and have something for you. It is VERY rough and ready, and only really works in Firefox (IE causes problems with CSS at the moment), but the below should be good as a starting point, for you to take forward and develop as you wish:
1. Put this into a post in Wordpress:
<div id="test2">
" rel="#overlay" style="text-decoration:none">
<button type="button">Show external page in overlay</button>
<div class="apple_overlay" id="overlay">
<div class="contentWrap"></div>
</div>
</div>
2. Copy this into notepad (or similar), and save as a php file:
/*
Plugin Name: jQuery Tools External Overlay
Description: A plugin that uses the "jQuery Tools Overlay" to provide a lightbox effect from external content
Version: 1.0
Author: alibby
*/
function my_init2() {
wp_enqueue_script('jquery');
echo '<script src=http://cdn.jquerytools.org/1.2.3/full/jquery.tools.min.js"></script>';
echo '<link rel="stylesheet" type="text/css" href=http://static.flowplayer.org/tools/css/overlay-apple.css"/>';
}
function load_into_head2() { ?>
<style>
/* use a semi-transparent image for the overlay */
#overlay {
background-image:urlhttp://static.flowplayer.org/img/overlay/transparent.png);
color:#efefef;
height:450px;
}
/* container for external content. uses vertical scrollbar, if needed */
div.contentWrap {
height:441px;
overflow-y:auto;
}
</style>
<script type="text/javascript">
$(function() {
$("#test2 a[rel]").overlay({
mask: 'darkred',
effect: 'apple',
onBeforeLoad: function() {
var wrap = this.getOverlay().find(".contentWrap");
wrap.load(this.getTrigger().attr("href"));
}
});
});
</script>
}
add_action( is_admin() ? 'admin_head' : 'wp_head', 'load_into_head2' );
add_action('init', 'my_init2');
?>
3. Drop the file from step 2 into a folder underneath your Wordpress plugins folder, and you should then be able to activate it in the normal way in Wordpress.
The output should give you the ability to open an overlay from within a post - it needs more work, and is very rough and ready, but hopefully this will give you something to work on. I'm pretty sure it needs tidying up in terms of how code should be written under Wordpress too...
I think I am getting somewhere, and have something for you. It is VERY rough and ready, and only really works in Firefox (IE causes problems with CSS at the moment), but the below should be good as a starting point, for you to take forward and develop as you wish:
1. Put this into a post in Wordpress:
<div id="test2">
" rel="#overlay" style="text-decoration:none">
<button type="button">Show external page in overlay</button>
<div class="apple_overlay" id="overlay">
<div class="contentWrap"></div>
</div>
</div>
2. Copy this into notepad (or similar), and save as a php file:
/*
Plugin Name: jQuery Tools External Overlay
Description: A plugin that uses the "jQuery Tools Overlay" to provide a lightbox effect from external content
Version: 1.0
Author: alibby
*/
function my_init2() {
wp_enqueue_script('jquery');
echo '<script src=http://cdn.jquerytools.org/1.2.3/full/jquery.tools.min.js"></script>';
echo '<link rel="stylesheet" type="text/css" href=http://static.flowplayer.org/tools/css/overlay-apple.css"/>';
}
function load_into_head2() { ?>
<style>
/* use a semi-transparent image for the overlay */
#overlay {
background-image:urlhttp://static.flowplayer.org/img/overlay/transparent.png);
color:#efefef;
height:450px;
}
/* container for external content. uses vertical scrollbar, if needed */
div.contentWrap {
height:441px;
overflow-y:auto;
}
</style>
<script type="text/javascript">
$(function() {
$("#test2 a[rel]").overlay({
mask: 'darkred',
effect: 'apple',
onBeforeLoad: function() {
var wrap = this.getOverlay().find(".contentWrap");
wrap.load(this.getTrigger().attr("href"));
}
});
});
</script>
}
add_action( is_admin() ? 'admin_head' : 'wp_head', 'load_into_head2' );
add_action('init', 'my_init2');
?>
3. Drop the file from step 2 into a folder underneath your Wordpress plugins folder, and you should then be able to activate it in the normal way in Wordpress.
The output should give you the ability to open an overlay from within a post - it needs more work, and is very rough and ready, but hopefully this will give you something to work on. I'm pretty sure it needs tidying up in terms of how code should be written under Wordpress too...
Reply to:
» » » » » » » » HTML with overlay in wordpress, from
alibby
HI Victor - and anyone else who wants the code:
I've figured (I hope) out how to do this without the need for a plugin, for anyone who needs the code. Give this a try:
1. Copy this code into a post:
<div id="test">
<button type="button">Show external page in overlay</button>
<div class="apple_overlay" id="overlay">
<div class="contentWrap"></div>
</div>
</div>
2. Put this line in, BEFORE the wp_head() command in the header:
wp_enqueue_script('jqtools', 'http://cdn.jquerytools.org/1.2.3/full/jquery.tools.min.js');
3. Put this in, immediately AFTER the wp_head() call:
<link rel="stylesheet" type="text/css" href=http://static.flowplayer.org/tools/css/overlay-apple.css"/>
<style>
#overlay { background-image:urlhttp://static.flowplayer.org/img/overlay/transparent.png); color:#efefef; height:450px; }
div.contentWrap { height:441px; overflow-y:auto; }
</style>
<script type="text/javascript">
$(function() {
// if the function argument is given to overlay,
// it is assumed to be the onBeforeLoad event listener
$("#test a[rel]").overlay({
mask: 'darkslateblue',
effect: 'apple',
onBeforeLoad: function() {
// grab wrapper element inside content
var wrap = this.getOverlay().find(".contentWrap");
// load the page specified in the trigger
wrap.load(this.getTrigger().attr("href"));
}
});
});
</script>
Hopefully this will give you a working overlay - it will not open files outside of your domain if you are working locally, but this is a feature of IE/FF not jQuery Tools. If you upload it online, hopefully this will allow you to point to an external page.
Give the above a try - it may not be perfect, but it seems to work for me under Wordpress 3.01
I've figured (I hope) out how to do this without the need for a plugin, for anyone who needs the code. Give this a try:
1. Copy this code into a post:
<div id="test">
<button type="button">Show external page in overlay</button>
<div class="apple_overlay" id="overlay">
<div class="contentWrap"></div>
</div>
</div>
2. Put this line in, BEFORE the wp_head() command in the header:
wp_enqueue_script('jqtools', 'http://cdn.jquerytools.org/1.2.3/full/jquery.tools.min.js');
3. Put this in, immediately AFTER the wp_head() call:
<link rel="stylesheet" type="text/css" href=http://static.flowplayer.org/tools/css/overlay-apple.css"/>
<style>
#overlay { background-image:urlhttp://static.flowplayer.org/img/overlay/transparent.png); color:#efefef; height:450px; }
div.contentWrap { height:441px; overflow-y:auto; }
</style>
<script type="text/javascript">
$(function() {
// if the function argument is given to overlay,
// it is assumed to be the onBeforeLoad event listener
$("#test a[rel]").overlay({
mask: 'darkslateblue',
effect: 'apple',
onBeforeLoad: function() {
// grab wrapper element inside content
var wrap = this.getOverlay().find(".contentWrap");
// load the page specified in the trigger
wrap.load(this.getTrigger().attr("href"));
}
});
});
</script>
Hopefully this will give you a working overlay - it will not open files outside of your domain if you are working locally, but this is a feature of IE/FF not jQuery Tools. If you upload it online, hopefully this will allow you to point to an external page.
Give the above a try - it may not be perfect, but it seems to work for me under Wordpress 3.01
Reply to:
» » » » » » » » » HTML with overlay in wordpress, from
alibby
Hi Victor,
Did this work OK for you?
Did this work OK for you?
Reply to:
» » » » » » » » » » HTML with overlay in wordpress, from
alibby
Hi alibby
I have not had time to try this one out yet, currently working on another project that have higher priority, i may be able to test it during the weekend
Thanks
/victor
I have not had time to try this one out yet, currently working on another project that have higher priority, i may be able to test it during the weekend
Thanks
/victor
Reply to:
» » » » » » » » » » » HTML with overlay in wordpress, from
victorjohansson
No problem - shout if I can be of any help.
Reply to:
» » » » » » » » » » » » HTML with overlay in wordpress, from
alibby
Try remove the line
because it will include another jquery lib from wordpress core.
However, seperate jquery tool is not working yet.
<?php wp_head();?> out of header.php
because it will include another jquery lib from wordpress core.
However, seperate jquery tool is not working yet.
