Hi,

is it possible to hide the title ?
I've tried all of the six style (default + example1..5), but all contains title.
I've added the following to my custom css, but the title is still there...

/*#cboxTitle {
  display: none; 
}

How to hide the title ?

Comments

mandreato’s picture

Sorry, the custom css was:

#cboxTitle {
  display: none;
}
hutch’s picture

That's because the display styling is inline:

<div style="display: block;" class="" id="cboxTitle">Your Title</div>

You *might* be able to get rid of it by writing a piece of jquery js to override it, this would have to run after the colorbox code, not so easy but might work if put in the footer.
This is untested:

$("#cboxTitle").removeAttr('style');
$("#cboxTitle").attr({'style': 'display: none'});

A hack but it might be worth a try ;-)

mandreato’s picture

Thank you hutch for the advice, but I'm a newbie... Where exactly have I to inject that js code ?
Maybe somewhere in the ...\sites\all\modules\colorbox folder ?

hutch’s picture

Probably the easiest way would to put it in your theme's page.tpl.php, wrapped in

<script type="text/javascript">
... code in here
</script>

Put it at the bottom, just above the body close tag

No guarantee that it will work though.

mandreato’s picture

Unfortunaly it doesn't work.
I've added the following code in the page.tpl.php of my theme (I'm sure it's the right one because, adding a fake wrong syntax, it does raise an error message on the browser):

<script type="text/javascript">
  $("#cboxTitle").removeAttr('style');
  $("#cboxTitle").attr({'style': 'display: none'});
</script>

but the title is still there.

frjo’s picture

Status: Active » Fixed

In my testing adding "!important" to the CSS declaration works:

#cboxTitle {
  display: none !important;
}
mandreato’s picture

Status: Fixed » Closed (fixed)

Yes it works !
Thank you for mentioning the !important statement !