Deprecated: Function set_magic_quotes_runtime() is deprecated in /home4/mfoster/public_html/cb/forums/include/common.php on line 62

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 31

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 32

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 33

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 34
Cross-Browser.com / X 'Persistent Display' Demo - Getting to work on Blogspot

Cross-Browser.com

X Library Forums

You are not logged in.

Announcement

New user registration is currently disabled.

#1 December 19, 2010 2:52:18 pm

darkufo
New Member
Registered: December 18, 2010
Posts: 9

X 'Persistent Display' Demo - Getting to work on Blogspot

Hi,

I've been trying to implement this on a test blogger site with the intention of allow users to show/hide various elements of the site.

http://cross-browser.com/x/examples/persistent_display.php

However, I for the life of me cannot port this to Blogger.

I've a test blog here that I've set the code up on.
http://lostbloopers.blogspot.com/

I don't suppose someone could cast an eye to see what I've done wrong.

Many thanks in advance.

Cheers
Andy

Offline

 

#2 December 20, 2010 10:05:44 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: X 'Persistent Display' Demo - Getting to work on Blogspot

Hi darkufo, Welcome to the forums!

Sorry for the late reply. Been out of town, now trying to catch up on work piled up while I was gone.

I'll take a look at your site and get back with comments soon.

thanks! smile

Offline

 

#3 December 21, 2010 1:07:35 am

darkufo
New Member
Registered: December 18, 2010
Posts: 9

Re: X 'Persistent Display' Demo - Getting to work on Blogspot

Hey Mike,

Really appreciate it.

No huge rush as I'm out myself today at a Wedding. smile

Offline

 

#4 December 21, 2010 2:34:52 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: X 'Persistent Display' Demo - Getting to work on Blogspot

Hmm, not sure yet, but when I 'view source' it shows html entities instead of single quote characters around the IDs in the onclick handlers on the checkboxes. csvToggle doesn't seem to be called when I click. If those entities are really in the source, try changing them to single quote characters.

Offline

 

#5 December 21, 2010 8:15:22 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: X 'Persistent Display' Demo - Getting to work on Blogspot

I've got another "persistent display" demo coming up - much better than the first one. I'll post it soon.

smile

Offline

 

#6 December 21, 2010 9:57:15 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: X 'Persistent Display' Demo - Getting to work on Blogspot

Too much fun! smile

Here's another little toy: xPersistentDisplay Demo 2

Enjoy!

Offline

 

#7 December 22, 2010 6:21:01 am

darkufo
New Member
Registered: December 18, 2010
Posts: 9

Re: X 'Persistent Display' Demo - Getting to work on Blogspot

Thanks Mike, much appreciated.

I'll give this a go when I get home.

Tons of thanks for this.

Offline

 

#8 December 22, 2010 7:16:59 am

darkufo
New Member
Registered: December 18, 2010
Posts: 9

Re: X 'Persistent Display' Demo - Getting to work on Blogspot

Just tested and it works great.

Very grateful.

Offline

 

#9 December 22, 2010 7:32:51 am

darkufo
New Member
Registered: December 18, 2010
Posts: 9

Re: X 'Persistent Display' Demo - Getting to work on Blogspot

Just one more little question.

How would I go about automatically setting the boxes/options to checked and to have the initial state to display. Basically I would like everything to be displayed, cookies set to Displayed and users then untick to hide the elements they don't want.

Offline

 

#10 December 22, 2010 10:39:16 am

darkufo
New Member
Registered: December 18, 2010
Posts: 9

Re: X 'Persistent Display' Demo - Getting to work on Blogspot

Ok, I've got everything working smile

Could I be a pain and ask 2 more related questions.

1) Is there anyway to conditionally load a Javascript Libary based on the value of one of cookies.

eg

if cookieset then
<script src='http://cdn.wibiya.com/Toolbars/dir_0602/Toolbar_602028/Loader_602028.js' type='text/javascript'/>
endif


2) My site is a little slow currently and as a result it the hide/display of the various Divs happens after the page has loaded. Can this be improved so that the items are either hidden or displayed on actual load time as the page is parsed load.

eg
if cookieset then
divs etc go here
endif

Offline

 

#11 December 22, 2010 11:15:37 am

darkufo
New Member
Registered: December 18, 2010
Posts: 9

Re: X 'Persistent Display' Demo - Getting to work on Blogspot

Here is my sites with the options page (Scroll down)
http://www.spoilertv.com/p/customise-spoilertv.html

Offline

 

#12 December 22, 2010 11:57:19 am

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: X 'Persistent Display' Demo - Getting to work on Blogspot

I just finished making a change to support the default state being either displayed or not displayed. Be sure to view the source of the demo. I've provided a single Js file which contains all the code needed, compressed.

1) Yes.

2) Yes.

Offline

 

#13 December 22, 2010 12:06:15 pm

darkufo
New Member
Registered: December 18, 2010
Posts: 9

Re: X 'Persistent Display' Demo - Getting to work on Blogspot

Thanks Mike, that's really kind of you to package up the JS files into one. Makes it much more convenient.

Would you happen to have any examples of code that would load my 2 examples from about. I'm struggling with the code a little and how to get the cookie value of 1 particular

eg

if xpd-chk-0 is checked then load the external javascript library.

and

if xpd-chk-0 is checked
  documentwrites to output html
end if

Offline

 

#14 December 22, 2010 5:44:59 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: X 'Persistent Display' Demo - Getting to work on Blogspot

1) The checkbox may not be checked on page load, and/or the user may check/uncheck it later, so probably need to load the script in the click handler. The click handler is called during initialization as well as when a user clicks the checkbox. So for example:

  function clk() {
    var i = this._xpd_index, v = this.checked;
    dsp(i, v);
    set(i, v);
    if (v && i == 0) {
      xSmartLoad('script', 'need js URL here');
    }
  }



For reference:

xLoadScript - basic version
xSmartLoad - won't load the same URL twice
xSmartLoad2 - same as xSmartLoad but supports multiple URLs


2) Ah! I should have thought of this before - it's simple. Just give all "persistent elements" display:none in CSS. I've updated the demo to illustrate this.

Offline

 

#15 December 22, 2010 5:53:13 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: X 'Persistent Display' Demo - Getting to work on Blogspot

Note, in the above code post, the line: if (v && i == 0) { ... "i==0" is checking to see if this is for "xpd-chk-0".

Offline

 

#16 December 22, 2010 9:47:35 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: X 'Persistent Display' Demo - Getting to work on Blogspot

Oh, forgot to mention - since that demo now uses a compressed file, if you want to see the uncompressed source see: xPersistentDisplay

Offline

 

#17 December 23, 2010 1:50:05 am

darkufo
New Member
Registered: December 18, 2010
Posts: 9

Re: X 'Persistent Display' Demo - Getting to work on Blogspot

Mike, thank you so much for your time in helping me, it's very much appreciated.

I've learnt a lot in a few days smile

Thanks
Andy

Offline

 

Board footer

Powered by PunBB 1.2.15
Copyright © 2002–2005 Rickard Andersson

Expand Restore Select Format Eval Load