responsive-content icon indicating copy to clipboard operation
responsive-content copied to clipboard

documentation

Open reecegeorge opened this issue 13 years ago • 4 comments

Hi there, this is a good idea.

Ive looked at the documentation and I cant work out how to implement. I had a good look at the example sites but because its wordpress, I cannot see how its implemented in your code.

In other words, if I wanted to use this code in a simple html/css/javascript website, what would the code look like?

I think this code has a lot of potential but the documentation is very difficult for me to follow. If you want to really get some motivation behind this project, can you please work on a simple example website.

Regards

reecegeorge avatar Oct 27 '12 23:10 reecegeorge

Reecegeorge: this approach requires some basic server side logic, to alter your layout according to what screen width the each device reports. I've added a basic example of how this might happen in PHP: https://github.com/stephanfowler/responsive-content/blob/master/server-side-example.php

Let me know if you need any more help...

stephanfowler avatar Oct 28 '12 19:10 stephanfowler

The back-end is perfectly simple, but my colleagues and I can't figure out how to use the plugin itself.

We understand that when the user clicks on a link the plugin is supposed to fetch a HTML page and add it to a container DIV. What we can't figure out is how to action a page change or send the browser details via GET.

pea avatar Oct 30 '12 17:10 pea

pea: OK - not quite sure what you mean by "action a page change" or "send the browser details via GET".

If you mean: cause the ajax pageload to happen for regular link clicks, the plugin does all that for you. It binds click events, makes an ajax GET request to the link url with additional _rescon* query params, and populates the div you initiated the plugin on. So at minimum, just do $('#myDiv').responsiveContent()

Or if you mean: cause an ajax pageload via an api function call (e.g. one that takes a url as an argument), then it doesn't offer that currently but it would be easy to add. Fork it and add it, or I do could so if you need it. (This weekend, earliest.)

stephanfowler avatar Oct 30 '12 21:10 stephanfowler

See also how it's invoked on a live example site, for a more realistic initialisation: http://thechapmagazine.co.uk/cms/wp-content/themes/thechap/assets/js/main.js

stephanfowler avatar Oct 30 '12 22:10 stephanfowler