Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style type="text/css">
- #catapult-cookie-bar {display:none}
- </style>
- <script>
- jQuery(document).ready(function($) {
- //https://github.com/yellowtree/geoip-detect/wiki/API%3A-AJAX
- geoip_detect.get_info().then(function(record) {
- if (record.error()) {
- console.error('WARNING Geodata Error:' + record.error() );
- var my_css_class_2 = { display : 'block' };
- $("#catapult-cookie-bar").css(my_css_class_2); //show in case
- }
- // Debug: Show raw data of record. (Warning: No property in this object is guaranteed to exist.)
- //console.log(record.get('continent', 'Null'));
- if ( record.get('continent', 'Europe') == "Europe" ) {
- //console.log('Europe!');
- var my_css_class_2 = { display : 'block' };
- $("#catapult-cookie-bar").css(my_css_class_2);
- //https://stackoverflow.com/questions/1212500/create-a-css-rule-class-with-jquery-at-runtime
- } else {
- //console.log('Not Europe!');
- //var my_css_class = { display : 'none' };
- //$("#catapult-cookie-bar").css(my_css_class);
- };
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement